System.err.println("@@@"+horiz+":"+vert+":"+width+":"+height+":"+stopX+":"+stopY);
    public static void flip(IBoard board, boolean horiz, boolean vert ) {        // If we're not flipping around *some* axis, do nothing.        if ( !vert && !horiz ) {            return;        }        // We only walk through half the board, but *which* half?        int stopX;        int stopY;        int width = board.getWidth();        int height = board.getHeight();                if ( horiz ) {            // West half of board.            stopX = width/2;            stopY = height;        } else {            // North half of board.            stopX = width;            stopY = height/2;        }System.err.println("@@@"+horiz+":"+vert+":"+width+":"+height+":"+stopX+":"+stopY);        // Walk through the current data array and build a new one.        int newX;        int newY;        int newIndex;        int oldIndex;        IHex tempHex;        ITerrain terr;        for ( int oldX = 0; oldX < stopX; oldX++ ) {            // Calculate the new X position of the flipped hex.            if (horiz) {                newX = width - oldX - 1;            } else {                newX = oldX;            }            for ( int oldY = 0; oldY < stopY; oldY++ ) {                // Calculate the new Y position of the flipped hex.                if (vert) {                    newY = height - oldY - 1;                } else {                    newY = oldY;                }System.err.println("\t:"+oldX+":"+oldY+":"+newX+":"+newY);                // Swap the old hex for the new hex.                tempHex = board.getHex(oldX, oldY);                board.setHex(oldX, oldY, board.getHex(newX, newY));                board.setHex(newX, newY,tempHex);                IHex newHex = board.getHex(newX, newY);                IHex oldHex = board.getHex(oldX, oldY);                // Update the road exits in the swapped hexes.                terr = newHex.getTerrain(Terrains.ROAD);                if ( null != terr ) {                    terr.flipExits(horiz, vert);                }                terr = oldHex.getTerrain(Terrains.ROAD);                if ( null != terr ) {                    terr.flipExits(horiz, vert);                }                // Update the building exits in the swapped hexes.                terr = newHex.getTerrain( Terrains.BUILDING );                if ( null != terr ) {                    terr.flipExits( horiz, vert );                }                terr = oldHex.getTerrain(Terrains.BUILDING);                if ( null != terr ) {                    terr.flipExits( horiz, vert );                }                // Update the bridge exits in the swapped hexes.                terr = newHex.getTerrain( Terrains.BRIDGE );                if ( null != terr ) {                    terr.flipExits( horiz, vert );                }                terr = oldHex.getTerrain( Terrains.BRIDGE );                if ( null != terr ) {                    terr.flipExits( horiz, vert );                }            }        }    }