soc.server
Class SOCBoardLargeAtServer

java.lang.Object
  extended by soc.game.SOCBoard
      extended by soc.game.SOCBoardLarge
          extended by soc.server.SOCBoardLargeAtServer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SOCBoardLargeAtServer
extends SOCBoardLarge

A subclass of SOCBoardLarge for the server, to isolate makeNewBoard(Map) and simplify that parent class. See SOCBoardLarge for more details. For the board layout geometry, see that class javadoc's "Coordinate System" section.

Sea board layout: A representation of a larger (up to 127 x 127 hexes) JSettlers board, with an arbitrary mix of land and water tiles. Implements SOCBoard.BOARD_ENCODING_LARGE. Activated with SOCGameOption "SBL".

A SOCGame uses this board; the board is not given a reference to the game, to enforce layering and keep the board logic simple. Game rules should be enforced at the game, not the board. Calling board methods won't change the game state.

On this large sea board, there can optionally be multiple "land areas" (groups of islands, or subsets of islands), if SOCBoardLarge.getLandAreasLegalNodes() != null. Land areas are groups of nodes on land; call SOCBoardLarge.getNodeLandArea(int) to find a node's land area number. The starting land area is SOCBoardLarge.getStartingLandArea(), if players must start in a certain area. During board setup, makeNewBoard(Map) calls makeNewBoard_placeHexes(int[], int[], int[], boolean, boolean, int, boolean, int, SOCGameOption, String) once for each land area. In some game scenarios, players and the robber can be excluded from placing in some land areas.

It's also possible for an island to have more than one landarea (as in scenario SC_TTD). In this case you should have a border zone of hexes with no landarea, because the landareas are tracked by their hexes' nodes, not by the hexes, and a node can't be in multiple LAs.

To Add a New Board:

To add a new board layout type, for a new game option or scenario: You'll need to declare all parts of its layout, recognize its scenario or game option in makeNewBoard, and call methods to set up the structure. These layout parts' values can be different for 3, 4, or 6 players.

A good example is SC_PIRI "Pirate Islands"; see commits 57073cb, f9623e5, and 112e289, or search this class for the string SC_PIRI.

Parts of the layout:

  * Some "land areas" may include water hexes, to vary the coastline from game to game.

Some scenarios may add other "layout parts" related to their scenario board layout. For example, scenario _SC_PIRI adds "PP" for the path followed by the pirate fleet. See SOCBoardLarge.getAddedLayoutPart(String), SOCBoardLarge.setAddedLayoutPart(String, int[]), and the list of added parts documented at the SOCBoardLayout2 class javadoc.

Since:
2.0.00
Author:
Jeremy D Monin <jeremy@nand.net>
See Also:
Serialized Form

Nested Class Summary
static class SOCBoardLargeAtServer.BoardFactoryAtServer
          Server-side implementation of SOCBoard.BoardFactory to create SOCBoardLargeAtServers.
 
Nested classes/interfaces inherited from class soc.game.SOCBoard
SOCBoard.BoardFactory, SOCBoard.DefaultBoardFactory
 
Field Summary
private static int[] CLVI_BOARDSIZE
          Cloth Villages: Board size: 4 players max row 0x0E, max col 0x10.
private static int[][] CLVI_CLOTH_VILLAGE_AMOUNTS_NODES_DICE
          Cloth Villages: Small islands' cloth village node locations and dice numbers.
private static int[][] CLVI_DICENUM_MAIN
          Cloth Villages: Dice numbers for hexes on the main island.
private static int[][] CLVI_LANDHEX_COORD_ISL
          Cloth Villages: Land hex coordinates for the several small middle islands, west to east.
private static int[][] CLVI_LANDHEX_COORD_MAIN
          Cloth Villages: Land hex coordinates for the main islands.
private static int[][] CLVI_LANDHEX_TYPE_ISL
          Cloth Villages: Hex land types on the several small middle islands, west to east.
private static int[][] CLVI_LANDHEX_TYPE_MAIN
          Cloth Villages: Land hex types for the main island.
private static int[] CLVI_PIRATE_HEX
          Cloth Villages: Starting pirate water hex coordinate for 4, 6 players.
private static int[][] CLVI_PORT_EDGE_FACING
          Cloth Villages: Port edges and facings.
private static int[][] CLVI_PORT_TYPE
          Cloth Villages: Port types; will be shuffled.
private  java.util.Stack<java.lang.Integer> drawStack
          For game scenarios such as _SC_FTRI, dev cards or other items waiting to be claimed by any player.
private static int FOG_ISL_BOARDSIZE_4PL
          Fog Island: Board size for 4 players: Max row 0x10, max col 0x11.
private static int FOG_ISL_BOARDSIZE_6PL
          Fog Island: Board size for 6 players: Max row 0x10, max col 0x14.
private static int[] FOG_ISL_DICENUM_FOG_3PL
          Fog Island: Dice numbers for hexes on the fog island.
private static int[] FOG_ISL_DICENUM_FOG_4PL
          Fog Island: Dice numbers for hexes on the fog island.
private static int[] FOG_ISL_DICENUM_FOG_6PL
          Fog Island: Dice numbers for hexes on the fog island.
private static int[] FOG_ISL_DICENUM_GC
          Fog Island: Dice numbers for hexes on the gold corners (6-player only).
private static int[] FOG_ISL_DICENUM_MAIN_3PL
          Fog Island: Dice numbers for hexes on the large southwest and northeast islands.
private static int[] FOG_ISL_DICENUM_MAIN_4PL
          Fog Island: Dice numbers for hexes on the large southwest and northeast islands.
private static int[] FOG_ISL_DICENUM_MAIN_6PL
          Fog Island: Dice numbers for hexes on the northern main island.
private static int[] FOG_ISL_LANDHEX_COORD_FOG_3PL
          Fog Island: Land and water hex coordinates for the fog island.
private static int[] FOG_ISL_LANDHEX_COORD_FOG_4PL
          Fog Island: Land and water hex coordinates for the fog island.
private static int[] FOG_ISL_LANDHEX_COORD_FOG_6PL
          Fog Island: Land and water hex coordinates for the fog island.
private static int[] FOG_ISL_LANDHEX_COORD_GC
          Fog Island: Land hex coordinates for the gold corners (6-player only).
private static int[] FOG_ISL_LANDHEX_COORD_MAIN_3PL
          Fog Island: Land hex coordinates for the large southwest and northeast islands.
private static int[] FOG_ISL_LANDHEX_COORD_MAIN_4PL
          Fog Island: Land hex coordinates for the large southwest and northeast islands.
private static int[] FOG_ISL_LANDHEX_COORD_MAIN_6PL
          Fog Island: Land hex coordinates for the northern main island.
private static int[] FOG_ISL_LANDHEX_TYPE_FOG
          Fog Island: Land and water hex types for the fog island.
private static int[] FOG_ISL_LANDHEX_TYPE_FOG_6PL
          Fog Island: Land and water hex types for the fog island.
private static int[] FOG_ISL_LANDHEX_TYPE_GC
          Fog Island: Land hex types for the gold corners (6-player only).
private static int[] FOG_ISL_LANDHEX_TYPE_MAIN_3PL
          Fog Island: Land hex types for the large southwest and northeast islands.
private static int[] FOG_ISL_LANDHEX_TYPE_MAIN_4PL
          Fog Island: Land hex types for the large southwest and northeast islands.
private static int[] FOG_ISL_LANDHEX_TYPE_MAIN_6PL
          Fog Island: Land hex types for the northern main island.
private static int[] FOG_ISL_PORT_EDGE_FACING_3PL
          Fog Island: Port edges and facings on the large southwest and northeast islands.
private static int[] FOG_ISL_PORT_EDGE_FACING_4PL
          Fog Island: Port edges and facings on the large southwest and northeast islands.
private static int[] FOG_ISL_PORT_EDGE_FACING_6PL
          Fog Island: Port edges and facings on the northern main island.
private static int[] FOG_ISL_PORT_TYPE_3PL
          Fog Island: Port types on the large southwest and northeast islands.
private static int[] FOG_ISL_PORT_TYPE_4PL
          Fog Island: Port types on the large southwest and northeast islands.
private static int[] FOG_ISL_PORT_TYPE_6PL
          Fog Island: Port types on the northern main island.
private static int[] FOR_TRI_BOARDSIZE
          Forgotten Tribe: Board size: 4 players max row 0x0E, max col 0x11.
private static int[][] FOR_TRI_DEV_CARD_EDGES
          Forgotten Tribe: Dev Card Edges: Edge coordinates where ship placement gives a free development card.
private static int[][] FOR_TRI_DICENUM_MAIN
          Forgotten Tribe: Dice numbers for hexes on the main island.
private static int[][] FOR_TRI_LANDHEX_COORD_ISL
          Forgotten Tribe: Land hex coordinates for the several small islands.
private static int[][] FOR_TRI_LANDHEX_COORD_MAIN
          Forgotten Tribe: Land hex coordinates for the main island.
private static int[][] FOR_TRI_LANDHEX_COORD_MAIN_FAR_COASTAL
          Forgotten Tribe: 3 Land hex coordinates on main island (within FOR_TRI_LANDHEX_COORD_MAIN) on the short eastern side.
private static int[][] FOR_TRI_LANDHEX_TYPE_ISL
          Forgotten Tribe: Hex land types on the several small islands.
private static int[][] FOR_TRI_LANDHEX_TYPE_MAIN
          Forgotten Tribe: Land hex types for the main island.
private static int[] FOR_TRI_PIRATE_HEX
          Forgotten Tribe: Starting pirate water hex coordinate for 4, 6 players.
private static int[][] FOR_TRI_PORT_EDGE_FACING
          Forgotten Tribe: Port edges and facings.
private static int[][] FOR_TRI_PORT_TYPE
          Forgotten Tribe: Port types; will be shuffled.
private static int[][] FOR_TRI_SVP_EDGES
          Forgotten Tribe: Special Victory Point Edges: edge coordinates where ship placement gives an SVP.
private static int FOUR_ISL_BOARDSIZE_4PL
          Four Islands: Board size for 4 players: Max row 0x10, max col 0x0e.
private static int FOUR_ISL_BOARDSIZE_6PL
          Four Islands: Board size for 6 players: Max row 0x10, max col 0x14.
private static int[] FOUR_ISL_DICENUM_3PL
          Four Islands: Dice numbers for all 4 islands.
private static int[] FOUR_ISL_DICENUM_4PL
          Four Islands: Dice numbers for hexes on all 4 islands.
private static int[] FOUR_ISL_DICENUM_6PL
          Six Islands: Dice numbers for hexes on all 6 islands.
private static int[] FOUR_ISL_LANDHEX_COORD_3PL
          Four Islands: Land hex coordinates for all 4 islands.
private static int[] FOUR_ISL_LANDHEX_COORD_4PL
          Four Islands: Land hex coordinates for all 4 islands.
private static int[] FOUR_ISL_LANDHEX_COORD_6PL
          Six Islands: Land hex coordinates for all 6 islands.
private static int[] FOUR_ISL_LANDHEX_LANDAREA_RANGES_3PL
          Four Islands: Island hex counts and land area numbers within FOUR_ISL_LANDHEX_COORD_3PL.
private static int[] FOUR_ISL_LANDHEX_LANDAREA_RANGES_4PL
          Four Islands: Island hex counts and land area numbers within FOUR_ISL_LANDHEX_COORD_4PL.
private static int[] FOUR_ISL_LANDHEX_LANDAREA_RANGES_6PL
          Six Islands: Island hex counts and land area numbers within FOUR_ISL_LANDHEX_COORD_6PL.
private static int[] FOUR_ISL_LANDHEX_TYPE_3PL
          Four Islands: Land hex types for all 4 islands.
private static int[] FOUR_ISL_LANDHEX_TYPE_4PL
          Four Islands: Land hex types for all 4 islands.
private static int[] FOUR_ISL_LANDHEX_TYPE_6PL
          Six Islands: Land hex types for all 6 islands.
private static int[] FOUR_ISL_PIRATE_HEX
          Four Islands: Pirate ship's starting hex coordinate for 3,4,6 players
private static int[] FOUR_ISL_PORT_EDGE_FACING_3PL
          Four Islands: Port edges and facings on all 4 islands.
private static int[] FOUR_ISL_PORT_EDGE_FACING_4PL
          Four Islands: Port edges and facings on all 4 islands.
private static int[] FOUR_ISL_PORT_EDGE_FACING_6PL
          Six Islands: Port edges and facings on all 6 islands.
private static int[] FOUR_ISL_PORT_TYPE_3PL
          Four Islands: Port types on all 4 islands.
private static int[] FOUR_ISL_PORT_TYPE_4PL
          Four Islands: Port types on all 4 islands.
private static int[] FOUR_ISL_PORT_TYPE_6PL
          Six Islands: Port types on all 6 islands.
private static int[] LANDHEX_COORD_ISLANDS_ALL_4PL
          Fallback board layout, 4 players: All the outlying islands' land hex coordinates.
private static int[] LANDHEX_COORD_ISLANDS_ALL_6PL
          Fallback board layout, 6 players: All the outlying islands' land hex coordinates.
private static int[][] LANDHEX_COORD_ISLANDS_EACH
          Fallback board layout for 4 players: Each outlying island's land hex coordinates.
private static int[] LANDHEX_COORD_MAINLAND
          Fallback board layout for 4 players: Main island's land hex coordinates, each row west to east.
private static int[] LANDHEX_DICENUM_ISLANDS_4PL
          Fallback board layout, 4 players: Dice numbers for the outlying islands.
private static int[] LANDHEX_DICENUM_ISLANDS_6PL
          Fallback board layout, 6 players: Dice numbers for the outlying islands.
private static int[] LANDHEX_DICEPATH_MAINLAND_4PL
          Fallback board layout for 4 players: Dice-number path (hex coordinates) on the main island, spiraling inward from the shore.
private static int[] LANDHEX_DICEPATH_MAINLAND_6PL
          Fallback board layout for 6 players: Dice-number path (hex coordinates) on the main island, spiraling inward from the shore.
private static int[] LANDHEX_LANDAREA_RANGES_ISLANDS_4PL
          4-player island hex counts and land area numbers within LANDHEX_COORD_ISLANDS_ALL_4PL.
private static int[] LANDHEX_LANDAREA_RANGES_ISLANDS_6PL
          4-player island hex counts and land area numbers within LANDHEX_COORD_ISLANDS_ALL_4PL.
private static int[] LANDHEX_TYPE_ISLANDS_4PL
          Fallback board layout, 4 players: Land hex types for the 3 small islands, to be used with (for the main island) SOCBoard.makeNewBoard_landHexTypes_v1[].
private static int[] LANDHEX_TYPE_ISLANDS_6PL
          Fallback board layout, 6 players: Land hex types for the 3 small islands, to be used with (for the main island) SOCBoard.makeNewBoard_landHexTypes_v2[].
private static int[] NSHO_BOARDSIZE
          New Shores: Board size: 3 players max row 0x0E, max col 0x0E.
private static int[][] NSHO_DICENUM_ISL
          New Shores: Dice numbers for hexes on the several small islands (NSHO_LANDHEX_COORD_ISL).
private static int[][] NSHO_DICENUM_MAIN
          New Shores: Dice numbers for hexes on the main island along NSHO_LANDHEX_COORD_MAIN.
private static int[][] NSHO_LANDHEX_COORD_ISL
          New Shores: Land hex coordinates for the several small islands.
private static int[][] NSHO_LANDHEX_COORD_MAIN
          New Shores: Land hex coordinates for the main island.
private static int[][] NSHO_LANDHEX_LANDAREA_RANGES
          New Shores: Island hex counts and land area numbers within NSHO_LANDHEX_COORD_ISL.
private static int[][] NSHO_LANDHEX_TYPE_ISL
          New Shores: Land hex types on the several small islands.
private static int[][] NSHO_LANDHEX_TYPE_MAIN
          New Shores: Land hex types for the main island.
private static int[] NSHO_PIRATE_HEX
          New Shores: Starting pirate water hex coordinate for 3, 4, 6 players.
private static int[][] NSHO_PORT_EDGE_FACING
          New Shores: Port edges and facings.
private static int[][] NSHO_PORT_TYPE
          New Shores: Port types on main island; will be shuffled.
private static int[] PIR_ISL_BOARDSIZE
          Pirate Islands: Board size: 4 players max row 0x10, max col 0x12.
private static int[][] PIR_ISL_DICENUM_MAIN
          Pirate Islands: Dice numbers for hexes on the large eastern starting island.
private static int[][] PIR_ISL_DICENUM_PIRI
          Pirate Islands: Dice numbers for the first few land hexes along PIR_ISL_LANDHEX_COORD_PIRI
private static int[][] PIR_ISL_INIT_PIECES
          Pirate Islands: Initial piece coordinates for each player, in same player order as PIR_ISL_SEA_EDGES (given out to non-vacant players, not strictly matching player number).
private static int[][] PIR_ISL_LANDHEX_COORD_MAIN
          Pirate Islands: Land hex coordinates for the large eastern starting island.
private static int[][] PIR_ISL_LANDHEX_COORD_PIRI
          Pirate Islands: Land hex coordinates for the several pirate islands.
private static int[][] PIR_ISL_LANDHEX_TYPE_MAIN
          Pirate Islands: Land hex types for the large eastern starting island.
private static int[][] PIR_ISL_LANDHEX_TYPE_PIRI
          Pirate Islands: Hex land types on the several pirate islands.
private static int[] PIR_ISL_PIRATE_HEX
          Pirate Islands: Starting pirate water hex coordinate for 4, 6 players.
private static int[][] PIR_ISL_PORT_EDGE_FACING
          Pirate Islands: Port edges and facings on the large eastern starting island.
private static int[][] PIR_ISL_PORT_TYPE
          Pirate Islands: Port types on the large eastern starting island.
private static int[][] PIR_ISL_PPATH
          Pirate Islands: The hex-coordinate path for the Pirate Fleet; SOCBoardLarge additional part "PP".
private static int[][][] PIR_ISL_SEA_EDGES
          Pirate Islands: Sea edges legal/valid for each player to build ships directly to their Fortress.
private  int piratePathIndex
          For game scenario option _SC_PIRI, the pirate fleet's position on its path (PP).
private static int[] PORT_EDGE_FACING_ISLANDS_4PL
          Fallback board layout, 4 players: Outlying islands' ports.
private static int[] PORT_EDGE_FACING_ISLANDS_6PL
          Fallback board layout, 6 players: Outlying islands' ports.
private static int[] PORT_EDGE_FACING_MAINLAND_4PL
          Fallback board layout for 4 players: Main island's ports, clockwise from its northwest.
private static int[] PORT_EDGE_FACING_MAINLAND_6PL
          Fallback board layout for 6 players: Main island's ports, clockwise from its western corner (like dice path).
private static int[] PORT_TYPE_ISLANDS_4PL
          Port types for the 4 outlying-island ports on the 4-player fallback board.
private static int[] PORT_TYPE_ISLANDS_6PL
          Port types for the 4 outlying-island ports on the 6-player fallback board.
private static long serialVersionUID
           
private static int[] TTDESERT_BOARDSIZE
          Through The Desert: Board size for 3, 4, 6 players: Each is 0xrrcc (max row, max col).
private static int[][] TTDESERT_DICENUM_MAIN
          Through The Desert: Dice numbers for hexes on the main island, including the strip of land past the desert.
private static int[][] TTDESERT_DICENUM_SMALL
          Through The Desert: Dice numbers for all the small islands (TTDESERT_LANDHEX_COORD_SMALL).
private static int[][] TTDESERT_LANDHEX_COORD_DESERT
          Through The Desert: Land hex coordinates for the strip of desert hexes on the main island.
private static int[][] TTDESERT_LANDHEX_COORD_MAIN
          Through The Desert: Land Area 1, 2: Land hex coordinates for the main island, excluding its desert strip but including the small fertile area on the desert's far side.
private static int[][] TTDESERT_LANDHEX_COORD_SMALL
          Through The Desert: Land Areas 3 to n: Land hex coordinates for all of the small "foreign" islands, one LA per island.
private static int[][] TTDESERT_LANDHEX_RANGES_MAIN
          Through The Desert: Land Areas 1, 2: Hex counts and Land area numbers for the main island, excluding its desert, within TTDESERT_LANDHEX_COORD_MAIN.
private static int[][] TTDESERT_LANDHEX_RANGES_SMALL
          Through The Desert: Land Areas 3 to n: Hex counts and Land area numbers for each of the small "foreign" islands, one per island, within TTDESERT_LANDHEX_COORD_SMALL.
private static int[][] TTDESERT_LANDHEX_TYPE_MAIN
          Through The Desert: Land hex types for the main island (land areas 1, 2).
private static int[][] TTDESERT_LANDHEX_TYPE_SMALL
          Through The Desert: Hex land types on the several small islands.
private static int[] TTDESERT_PIRATE_HEX
          Through The Desert: Starting pirate water hex coordinate for 3, 4, 6 players.
private static int[][] TTDESERT_PORT_EDGE_FACING
          Through The Desert: Port edges and facings on the main island.
private static int[][] TTDESERT_PORT_TYPE
          Through The Desert: Port types on the main island.
private static int[] WOND_BOARDSIZE
          Wonders: Board size: 4 players max row 0x0E, max col 0x12.
private static int[][] WOND_DICENUM_ISL
          Wonders: Dice numbers for hexes on the several small islands, same order as WOND_LANDHEX_COORD_ISL.
private static int[][] WOND_DICENUM_MAIN
          Wonders: Dice numbers for hexes on the main island.
private static int[][] WOND_LANDHEX_COORD_DESERT
          Wonders: Land hex coordinates for the deserts in the southwest of the main island.
private static int[][] WOND_LANDHEX_COORD_ISL
          Wonders: Land hex coordinates for the several small islands, west to east.
private static int[][] WOND_LANDHEX_COORD_MAIN
          Wonders: Land hex coordinates for the main island, excluding deserts (WOND_LANDHEX_COORD_DESERT).
private static int[][] WOND_LANDHEX_COORD_MAIN_AT_DESERT
          Wonders: 2 land hex coordinates on main island (within WOND_LANDHEX_COORD_MAIN) adjacent to the deserts (WOND_LANDHEX_COORD_DESERT).
private static int[][] WOND_LANDHEX_TYPE_ISL
          Wonders: Hex land types on the several small islands, west to east.
private static int[][] WOND_LANDHEX_TYPE_MAIN
          Wonders: Land hex types for the main island, excluding the desert.
private static int[][] WOND_PORT_EDGE_FACING
          Wonders: Port edges and facings.
private static int[][] WOND_PORT_TYPE
          Wonders: Port types; will be shuffled.
private static int[][][] WOND_SPECIAL_NODES
          Wonders: Special Node locations.
 
Fields inherited from class soc.game.SOCBoardLarge
BOARDHEIGHT_LARGE, BOARDWIDTH_LARGE, cachedGetLandHexCoords, FOG_HEX, fogHiddenHexes, GOLD_HEX, hexLayoutLg, landAreasLegalNodes, landHexLayout, legalRoadEdges, legalShipEdges, MAX_LAND_HEX_LG, maxPlayers, numberLayoutLg, pirateHex, portsCount, SPECIAL_EDGE_DEV_CARD, SPECIAL_EDGE_LAYOUT_PARTS, SPECIAL_EDGE_SVP, SPECIAL_EDGE_TYPES, startingLandArea, VERSION_FOR_ENCODING_LARGE, villages
 
Fields inherited from class soc.game.SOCBoard
BOARD_ENCODING_6PLAYER, BOARD_ENCODING_LARGE, BOARD_ENCODING_ORIGINAL, boardEncodingFormat, boardHeight, boardWidth, cities, CLAY_HEX, CLAY_PORT, CLAY_PORT_HEX, DESERT_HEX, FACING_E, FACING_NE, FACING_NW, FACING_SE, FACING_SW, FACING_W, HEXCOORDS_LAND_V1, HEXCOORDS_LAND_V2, makeNewBoard_diceNums_v1, makeNewBoard_diceNums_v2, makeNewBoard_landHexTypes_v1, makeNewBoard_landHexTypes_v2, MAX_BOARD_ENCODING, max_robber_hextype, MAXEDGE_V1, MAXEDGE_V2, MAXHEX, MINEDGE_V1, MINEDGE_V2, MINHEX, MINNODE_V1, MINNODE_V2, MISC_PORT, MISC_PORT_HEX, nodeIDtoPortType, nodesOnLand, ORE_HEX, ORE_PORT, ORE_PORT_HEX, ports, PORTS_TYPE_V1, PORTS_TYPE_V2, portsLayout, rand, roads, settlements, SHEEP_HEX, SHEEP_PORT, SHEEP_PORT_HEX, WATER_HEX, WHEAT_HEX, WHEAT_PORT, WHEAT_PORT_HEX, WOOD_HEX, WOOD_PORT, WOOD_PORT_HEX
 
Constructor Summary
SOCBoardLargeAtServer(java.util.Map<java.lang.String,SOCGameOption> gameOpts, int maxPlayers, IntPair boardHeightWidth)
          Create a new Settlers of Catan Board, with the v3 encoding.
 
Method Summary
 java.lang.Integer drawItemFromStack()
          If this scenario has dev cards or items waiting to be claimed by any player, draw the next item from that stack.
private static int getBoardSize(java.util.Map<java.lang.String,SOCGameOption> gameOpts, int maxPlayers)
          Get the board size for BoardFactoryAtServer.createBoard: The default size BOARDHEIGHT_LARGE by BOARDWIDTH_LARGE, unless gameOpts contains a scenario ("SC") whose layout has a custom height/width.
static int[][] getLegalSeaEdges(SOCGame ga, int forPN)
          For scenario game option _SC_PIRI, get the list of Legal Sea Edges arranged for the players not vacant.
private  void makeNewBoard_checkPortLocationsConsistent(int[] portsLocFacing)
          For makeNewBoard(Map), check port locations and facings, and make sure no port overlaps with a land hex.
private  void makeNewBoard_fillNodesOnLandFromHexes(int[] landHexCoords, int startIdx, int pastEndIdx, int landAreaNumber, boolean addToExistingLA)
          Calculate the board's legal settlement/city nodes, based on land hexes.
protected  void makeNewBoard_hideHexesInFog(int[] hexCoords)
          For makeNewBoard(Map), hide these hexes under SOCBoardLarge.FOG_HEX to be revealed later.
private  void makeNewBoard_placeHexes_arrangeGolds(int[] hexCoords, int[] landAreaPathRanges, java.lang.String scen)
          For makeNewBoard(Map), after placing land hexes and dice numbers into SOCBoardLarge.hexLayoutLg, fine-tune the randomized gold hex placement: Find and separate adjacent gold hexes.
private  int makeNewBoard_placeHexes_arrGolds_addToAdjacList(java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> goldAdjacGold, java.lang.Integer hex0, java.lang.Integer hex1)
          Add hex1 to hex0's adjacency list in this map; create that list if needed.
private  void makeNewBoard_placeHexes_arrGolds_swapWithRandom(java.lang.Integer goldHex, java.util.HashSet<java.lang.Integer> nonAdjac, java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> goldAdjacGold)
          Swap this gold hex with a random non-adjacent hex in hexLayoutLg.
private  void makeNewBoard_placeHexes_moveFrequentNumbers_buildArrays(int[] landPath, java.util.ArrayList<java.lang.Integer> redHexes, java.util.HashSet<java.lang.Integer> ignoreHexes, java.util.HashSet<java.lang.Integer> otherCoastalHexes, java.util.HashSet<java.lang.Integer> otherHexes, java.lang.String scen, java.util.HashSet<java.lang.Integer> otherHexesForScen)
          Build sets used for makeNewBoard_placeHexes_moveFrequentNumbers(int[], ArrayList, int, String).
private  java.util.HashSet<java.lang.Integer> makeNewBoard_placeHexes_moveFrequentNumbers_checkSpecialHexes(int[] landPath, java.util.ArrayList<java.lang.Integer> redHexes, int maxPl, java.lang.String scen)
          Check for any hexes that forbid too-frequent dice numbers (only a few scenarios).
private  IntTriple makeNewBoard_placeHexes_moveFrequentNumbers_swapOne(int swaphex, int swapi, java.util.ArrayList<java.lang.Integer> redHexes, java.util.HashSet<java.lang.Integer> ignoreHexes, java.util.HashSet<java.lang.Integer> otherCoastalHexes, java.util.HashSet<java.lang.Integer> otherHexes)
          The dice-number swapping algorithm for makeNewBoard_placeHexes_moveFrequentNumbers(int[], ArrayList, int, String).
private  boolean makeNewBoard_placeHexes_moveFrequentNumbers(int[] landPath, java.util.ArrayList<java.lang.Integer> redHexes, int maxPl, java.lang.String scen)
          For makeNewBoard(Map), after placing land hexes and dice numbers into hexLayoutLg and numberLayoutLg, separate adjacent "red numbers" (6s, 8s) and make sure gold hex dice aren't too frequent.
private  void makeNewBoard_placeHexes(int[] landHexType, int[] landPath, int[] number, boolean shuffleDiceNumbers, boolean shuffleLandHexes, int[] landAreaPathRanges, boolean addToExistingLA, int maxPl, SOCGameOption optBC, java.lang.String scen)
          For makeNewBoard(Map), place the land hexes, number, and robber for multiple land areas, after shuffling their common landHexType[].
private  void makeNewBoard_placeHexes(int[] landHexType, int[] landPath, int[] number, boolean shuffleDiceNumbers, boolean shuffleLandHexes, int landAreaNumber, boolean addToExistingLA, int maxPl, SOCGameOption optBC, java.lang.String scen)
          For makeNewBoard(Map), place the land hexes, number, and robber, after shuffling landHexType[].
private  void makeNewBoard_removeLegalNodes(int[] nodeCoords, int landAreaNumber, int addNodeListNumber, boolean emptyPartAfterInitPlace)
          For makeNewBoard(Map), remove some nodes from legal/potential initial placement locations.
 void makeNewBoard(java.util.Map<java.lang.String,SOCGameOption> opts)
          Shuffle the hex tiles and layout a board.
 int movePirateHexAlongPath(int numSteps)
          For game scenario option _SC_PIRI, move the pirate fleet's position along its path.
 void startGame_putInitPieces(SOCGame ga)
          For scenario game option _SC_PIRI, place each player's initial pieces.
 
Methods inherited from class soc.game.SOCBoardLarge
addLegalNodes, addLoneLegalSettlements, canRemovePort, clearSpecialEdges, distributeClothFromRoll, edgeCoordToString, getAddedLayoutPart, getAddedLayoutParts, getAdjacentEdgesToEdge, getAdjacentEdgesToHex, getAdjacentEdgesToNode_coastal, getAdjacentEdgeToNode, getAdjacentEdgeToNode2Away, getAdjacentHexesToEdge_arr, getAdjacentHexesToEdgeEnds, getAdjacentHexesToHex, getAdjacentHexesToNode, getAdjacentHexToEdge, getAdjacentNodesToEdge_arr, getAdjacentNodesToEdge, getAdjacentNodesToHex, getAdjacentNodeToEdge, getAdjacentNodeToHex, getAdjacentNodeToNode, getAdjacentNodeToNode2Away, getCloth, getEdgeBetweenAdjacentNodes, getHexLayout, getHexNumFromCoord, getHexTypeFromCoord, getHexTypeFromNumber, getLandAreasLegalNodes, getLandHexCoords, getLandHexCoordsSet, getLandHexLayout, getLegalAndPotentialSettlements, getNodeBetweenAdjacentEdges, getNodeLandArea, getNumberLayout, getNumberOnHexFromCoord, getNumberOnHexFromNumber, getPirateHex, getPlayerExcludedLandAreas, getPortEdgeFromNode, getPortFacingFromEdge, getPortsCount, getPortsEdges, getPortsFacing, getPreviousPirateHex, getRobberExcludedLandAreas, getSpecialEdges, getSpecialEdgeType, getStartingLandArea, getVillageAndClothLayout, getVillageAtNode, getVillages, hasSpecialEdges, initLegalRoadsFromLandNodes, initLegalShipEdges, isEdgeAdjacentToHex, isEdgeAdjacentToNode, isEdgeCoastline, isEdgeInBounds, isHexAdjacentToHex, isHexAtBoardMargin, isHexCoastline, isHexInBounds, isHexInLandAreas, isHexOnLand, isHexOnWater, isNode2AwayFromNode, isNodeCoastline, isNodeInBounds, isNodeInLandAreas, putPiece, removePort, revealFogHiddenHexPrep, setAddedLayoutPart, setAddedLayoutParts, setCloth, setHexLayout, setLandHexLayout, setLegalAndPotentialSettlements, setNumberLayout, setPirateHex, setPlayerExcludedLandAreas, setPortsLayout, setRobberExcludedLandAreas, setSpecialEdge, setSpecialEdges, setVillageAndClothLayout, takeCloth
 
Methods inherited from class soc.game.SOCBoard
getAdjacentEdgesToNode_arr, getAdjacentEdgesToNode, getAdjacentNodeFarEndOfEdge, getAdjacentNodesToNode_arr, getAdjacentNodesToNode, getBoardEncodingFormat, getBoardHeight, getBoardWidth, getCities, getPortCoordinates, getPortDescForType, getPortsLayout, getPortTypeFromNodeCoord, getPreviousRobberHex, getRoads, getRobberHex, getSettlements, isNodeAdjacentToNode, isNodeOnLand, makeNewBoard_checkLandHexResourceClumps, makeNewBoard_shufflePorts, nodeCoordToString, placePort, removePiece, roadAtEdge, setBoardBounds, setBoardEncodingFormat, setRobberHex, settlementAtNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

drawStack

private java.util.Stack<java.lang.Integer> drawStack
For game scenarios such as _SC_FTRI, dev cards or other items waiting to be claimed by any player. Otherwise null.

Initialized in startGame_putInitPieces(SOCGame) based on game options. Accessed with drawItemFromStack().

In _SC_FTRI, each item is a SOCDevCardConstants card type.


piratePathIndex

private int piratePathIndex
For game scenario option _SC_PIRI, the pirate fleet's position on its path (PP). Otherwise unused.

See Also:
movePirateHexAlongPath(int)

PORT_EDGE_FACING_MAINLAND_4PL

private static final int[] PORT_EDGE_FACING_MAINLAND_4PL
Fallback board layout for 4 players: Main island's ports, clockwise from its northwest. Each port has 2 consecutive elements. First: Port edge coordinate, in hex: 0xRRCC. Second: Port Facing direction: FACING_E, etc.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.


PORT_EDGE_FACING_ISLANDS_4PL

private static final int[] PORT_EDGE_FACING_ISLANDS_4PL
Fallback board layout, 4 players: Outlying islands' ports. Each port has 2 elements. First: Coordinate, in hex: 0xRRCC. Second: Facing


PORT_TYPE_ISLANDS_4PL

private static final int[] PORT_TYPE_ISLANDS_4PL
Port types for the 4 outlying-island ports on the 4-player fallback board. For the mainland's port types, use SOCBoard.PORTS_TYPE_V1.


LANDHEX_DICEPATH_MAINLAND_4PL

private static final int[] LANDHEX_DICEPATH_MAINLAND_4PL
Fallback board layout for 4 players: Dice-number path (hex coordinates) on the main island, spiraling inward from the shore. The outlying islands have no dice path. For the mainland's dice numbers, see SOCBoard.makeNewBoard_diceNums_v1.

See Also:
LANDHEX_COORD_MAINLAND

LANDHEX_COORD_MAINLAND

private static final int[] LANDHEX_COORD_MAINLAND
Fallback board layout for 4 players: Main island's land hex coordinates, each row west to east.

See Also:
LANDHEX_DICEPATH_MAINLAND_4PL

LANDHEX_COORD_ISLANDS_ALL_4PL

private static final int[] LANDHEX_COORD_ISLANDS_ALL_4PL
Fallback board layout, 4 players: All the outlying islands' land hex coordinates.

The first outlying island (land area 2) is upper-right on board. Second island (landarea 3) is lower-right. Third island (landarea 4) is lower-left.

See Also:
LANDHEX_COORD_ISLANDS_EACH, LANDHEX_LANDAREA_RANGES_ISLANDS_4PL

LANDHEX_COORD_ISLANDS_EACH

private static final int[][] LANDHEX_COORD_ISLANDS_EACH
Fallback board layout for 4 players: Each outlying island's land hex coordinates.

See Also:
LANDHEX_COORD_ISLANDS_ALL_4PL, LANDHEX_LANDAREA_RANGES_ISLANDS_4PL

LANDHEX_LANDAREA_RANGES_ISLANDS_4PL

private static final int[] LANDHEX_LANDAREA_RANGES_ISLANDS_4PL
4-player island hex counts and land area numbers within LANDHEX_COORD_ISLANDS_ALL_4PL. Allows us to shuffle them all together (LANDHEX_TYPE_ISLANDS_4PL).

See Also:
LANDHEX_COORD_ISLANDS_EACH

LANDHEX_TYPE_ISLANDS_4PL

private static final int[] LANDHEX_TYPE_ISLANDS_4PL
Fallback board layout, 4 players: Land hex types for the 3 small islands, to be used with (for the main island) SOCBoard.makeNewBoard_landHexTypes_v1[].


LANDHEX_DICENUM_ISLANDS_4PL

private static final int[] LANDHEX_DICENUM_ISLANDS_4PL
Fallback board layout, 4 players: Dice numbers for the outlying islands. These islands have no required path for numbers; as long as the frequently rolled ("red") 6 and 8 aren't adjacent, and as long as GOLD_HEXes have rare numbers, all is OK. To make the islands more attractive, avoids the infrequntly rolled 2 and 12.


LANDHEX_DICEPATH_MAINLAND_6PL

private static final int[] LANDHEX_DICEPATH_MAINLAND_6PL
Fallback board layout for 6 players: Dice-number path (hex coordinates) on the main island, spiraling inward from the shore. The outlying islands have no dice path. For the mainland's dice numbers, see SOCBoard.makeNewBoard_diceNums_v2.


PORT_EDGE_FACING_MAINLAND_6PL

private static final int[] PORT_EDGE_FACING_MAINLAND_6PL
Fallback board layout for 6 players: Main island's ports, clockwise from its western corner (like dice path). Each port has 2 consecutive elements. First: Port edge coordinate, in hex: 0xRRCC. Second: Port Facing direction: FACING_E, etc.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.


LANDHEX_COORD_ISLANDS_ALL_6PL

private static final int[] LANDHEX_COORD_ISLANDS_ALL_6PL
Fallback board layout, 6 players: All the outlying islands' land hex coordinates.

The first outlying island (land area 2) is upper-right on board. Second island (landarea 3) is lower-right. Third island (landarea 4) is lower-left.

See Also:
LANDHEX_LANDAREA_RANGES_ISLANDS_6PL

LANDHEX_LANDAREA_RANGES_ISLANDS_6PL

private static final int[] LANDHEX_LANDAREA_RANGES_ISLANDS_6PL
4-player island hex counts and land area numbers within LANDHEX_COORD_ISLANDS_ALL_4PL. Allows us to shuffle them all together (LANDHEX_TYPE_ISLANDS_6PL).

See Also:
LANDHEX_COORD_ISLANDS_EACH

LANDHEX_TYPE_ISLANDS_6PL

private static final int[] LANDHEX_TYPE_ISLANDS_6PL
Fallback board layout, 6 players: Land hex types for the 3 small islands, to be used with (for the main island) SOCBoard.makeNewBoard_landHexTypes_v2[].


LANDHEX_DICENUM_ISLANDS_6PL

private static final int[] LANDHEX_DICENUM_ISLANDS_6PL
Fallback board layout, 6 players: Dice numbers for the outlying islands. These islands have no required path for numbers; as long as the frequently rolled ("red") 6 and 8 aren't adjacent, and as long as GOLD_HEXes have rare numbers, all is OK. To make the islands more attractive, avoids the infrequntly rolled 2 and 12.


PORT_EDGE_FACING_ISLANDS_6PL

private static final int[] PORT_EDGE_FACING_ISLANDS_6PL
Fallback board layout, 6 players: Outlying islands' ports. Each port has 2 elements. First: Coordinate, in hex: 0xRRCC. Second: Facing


PORT_TYPE_ISLANDS_6PL

private static final int[] PORT_TYPE_ISLANDS_6PL
Port types for the 4 outlying-island ports on the 6-player fallback board. For the mainland's port types, use SOCBoard.PORTS_TYPE_V2.


NSHO_BOARDSIZE

private static final int[] NSHO_BOARDSIZE
New Shores: Board size: 3 players max row 0x0E, max col 0x0E. 4 players max 0x0E, 0x10. 6 players max 0x0E, 0x14.


NSHO_PIRATE_HEX

private static final int[] NSHO_PIRATE_HEX
New Shores: Starting pirate water hex coordinate for 3, 4, 6 players. The 6-player layout starts with the pirate off the board.


NSHO_LANDHEX_TYPE_MAIN

private static final int[][] NSHO_LANDHEX_TYPE_MAIN
New Shores: Land hex types for the main island. Shuffled.


NSHO_LANDHEX_COORD_MAIN

private static final int[][] NSHO_LANDHEX_COORD_MAIN
New Shores: Land hex coordinates for the main island. Defines the path and sequence of dice numbers in NSHO_DICENUM_MAIN. Land hex types (shuffled) are NSHO_LANDHEX_TYPE_MAIN.

See Also:
NSHO_LANDHEX_COORD_ISL

NSHO_DICENUM_MAIN

private static final int[][] NSHO_DICENUM_MAIN
New Shores: Dice numbers for hexes on the main island along NSHO_LANDHEX_COORD_MAIN. Shuffled for 3-player board only.

See Also:
NSHO_DICENUM_ISL

NSHO_PORT_EDGE_FACING

private static final int[][] NSHO_PORT_EDGE_FACING
New Shores: Port edges and facings. There are no ports on the small islands, only the main one.

Clockwise, starting at northwest corner of board. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Port types (NSHO_PORT_TYPE) are shuffled.


NSHO_PORT_TYPE

private static final int[][] NSHO_PORT_TYPE
New Shores: Port types on main island; will be shuffled.


NSHO_LANDHEX_TYPE_ISL

private static final int[][] NSHO_LANDHEX_TYPE_ISL
New Shores: Land hex types on the several small islands. Shuffled.


NSHO_LANDHEX_LANDAREA_RANGES

private static final int[][] NSHO_LANDHEX_LANDAREA_RANGES
New Shores: Island hex counts and land area numbers within NSHO_LANDHEX_COORD_ISL. Allows them to be defined, shuffled, and placed together.


NSHO_LANDHEX_COORD_ISL

private static final int[][] NSHO_LANDHEX_COORD_ISL
New Shores: Land hex coordinates for the several small islands. Each island is a separate land area, split up the array using NSHO_LANDHEX_LANDAREA_RANGES. Dice numbers on the islands (shuffled together) are NSHO_DICENUM_ISL.

See Also:
NSHO_LANDHEX_COORD_MAIN

NSHO_DICENUM_ISL

private static final int[][] NSHO_DICENUM_ISL
New Shores: Dice numbers for hexes on the several small islands (NSHO_LANDHEX_COORD_ISL). Shuffled.

See Also:
NSHO_DICENUM_MAIN

FOG_ISL_LANDHEX_TYPE_MAIN_3PL

private static final int[] FOG_ISL_LANDHEX_TYPE_MAIN_3PL
Fog Island: Land hex types for the large southwest and northeast islands.


FOG_ISL_LANDHEX_COORD_MAIN_3PL

private static final int[] FOG_ISL_LANDHEX_COORD_MAIN_3PL
Fog Island: Land hex coordinates for the large southwest and northeast islands.


FOG_ISL_DICENUM_MAIN_3PL

private static final int[] FOG_ISL_DICENUM_MAIN_3PL
Fog Island: Dice numbers for hexes on the large southwest and northeast islands. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOG_ISL_PORT_EDGE_FACING_3PL

private static final int[] FOG_ISL_PORT_EDGE_FACING_3PL
Fog Island: Port edges and facings on the large southwest and northeast islands. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Each port's type will be FOG_ISL_PORT_TYPE_3PL.


FOG_ISL_PORT_TYPE_3PL

private static final int[] FOG_ISL_PORT_TYPE_3PL
Fog Island: Port types on the large southwest and northeast islands. Since these won't be shuffled, they will line up with FOG_ISL_PORT_EDGE_FACING_3PL.


FOG_ISL_LANDHEX_TYPE_FOG

private static final int[] FOG_ISL_LANDHEX_TYPE_FOG
Fog Island: Land and water hex types for the fog island. Shared by 3-player and 4-player layouts.


FOG_ISL_LANDHEX_COORD_FOG_3PL

private static final int[] FOG_ISL_LANDHEX_COORD_FOG_3PL
Fog Island: Land and water hex coordinates for the fog island. Hex types for the fog island are FOG_ISL_LANDHEX_TYPE_FOG.


FOG_ISL_DICENUM_FOG_3PL

private static final int[] FOG_ISL_DICENUM_FOG_3PL
Fog Island: Dice numbers for hexes on the fog island. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOG_ISL_BOARDSIZE_4PL

private static final int FOG_ISL_BOARDSIZE_4PL
Fog Island: Board size for 4 players: Max row 0x10, max col 0x11.

See Also:
Constant Field Values

FOG_ISL_LANDHEX_TYPE_MAIN_4PL

private static final int[] FOG_ISL_LANDHEX_TYPE_MAIN_4PL
Fog Island: Land hex types for the large southwest and northeast islands.


FOG_ISL_LANDHEX_COORD_MAIN_4PL

private static final int[] FOG_ISL_LANDHEX_COORD_MAIN_4PL
Fog Island: Land hex coordinates for the large southwest and northeast islands.


FOG_ISL_DICENUM_MAIN_4PL

private static final int[] FOG_ISL_DICENUM_MAIN_4PL
Fog Island: Dice numbers for hexes on the large southwest and northeast islands. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOG_ISL_PORT_EDGE_FACING_4PL

private static final int[] FOG_ISL_PORT_EDGE_FACING_4PL
Fog Island: Port edges and facings on the large southwest and northeast islands. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Each port's type will be FOG_ISL_PORT_TYPE_4PL.


FOG_ISL_PORT_TYPE_4PL

private static final int[] FOG_ISL_PORT_TYPE_4PL
Fog Island: Port types on the large southwest and northeast islands. Since these won't be shuffled, they will line up with FOG_ISL_PORT_EDGE_FACING_4PL.


FOG_ISL_LANDHEX_COORD_FOG_4PL

private static final int[] FOG_ISL_LANDHEX_COORD_FOG_4PL
Fog Island: Land and water hex coordinates for the fog island. Hex types for the fog island are FOG_ISL_LANDHEX_TYPE_FOG.


FOG_ISL_DICENUM_FOG_4PL

private static final int[] FOG_ISL_DICENUM_FOG_4PL
Fog Island: Dice numbers for hexes on the fog island. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOG_ISL_BOARDSIZE_6PL

private static final int FOG_ISL_BOARDSIZE_6PL
Fog Island: Board size for 6 players: Max row 0x10, max col 0x14.

See Also:
Constant Field Values

FOG_ISL_LANDHEX_TYPE_MAIN_6PL

private static final int[] FOG_ISL_LANDHEX_TYPE_MAIN_6PL
Fog Island: Land hex types for the northern main island.


FOG_ISL_LANDHEX_COORD_MAIN_6PL

private static final int[] FOG_ISL_LANDHEX_COORD_MAIN_6PL
Fog Island: Land hex coordinates for the northern main island.


FOG_ISL_DICENUM_MAIN_6PL

private static final int[] FOG_ISL_DICENUM_MAIN_6PL
Fog Island: Dice numbers for hexes on the northern main island. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOG_ISL_PORT_EDGE_FACING_6PL

private static final int[] FOG_ISL_PORT_EDGE_FACING_6PL
Fog Island: Port edges and facings on the northern main island. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Each port's type will be from FOG_ISL_PORT_TYPE_6PL which is shuffled.


FOG_ISL_PORT_TYPE_6PL

private static final int[] FOG_ISL_PORT_TYPE_6PL
Fog Island: Port types on the northern main island. These will be shuffled. Port locations are in FOG_ISL_PORT_EDGE_FACING_6PL.


FOG_ISL_LANDHEX_TYPE_FOG_6PL

private static final int[] FOG_ISL_LANDHEX_TYPE_FOG_6PL
Fog Island: Land and water hex types for the fog island.


FOG_ISL_LANDHEX_COORD_FOG_6PL

private static final int[] FOG_ISL_LANDHEX_COORD_FOG_6PL
Fog Island: Land and water hex coordinates for the fog island. Hex types for the fog island are FOG_ISL_LANDHEX_TYPE_FOG_6PL.


FOG_ISL_DICENUM_FOG_6PL

private static final int[] FOG_ISL_DICENUM_FOG_6PL
Fog Island: Dice numbers for hexes on the fog island. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOG_ISL_LANDHEX_TYPE_GC

private static final int[] FOG_ISL_LANDHEX_TYPE_GC
Fog Island: Land hex types for the gold corners (6-player only).


FOG_ISL_LANDHEX_COORD_GC

private static final int[] FOG_ISL_LANDHEX_COORD_GC
Fog Island: Land hex coordinates for the gold corners (6-player only).


FOG_ISL_DICENUM_GC

private static final int[] FOG_ISL_DICENUM_GC
Fog Island: Dice numbers for hexes on the gold corners (6-player only).


FOUR_ISL_PIRATE_HEX

private static final int[] FOUR_ISL_PIRATE_HEX
Four Islands: Pirate ship's starting hex coordinate for 3,4,6 players


FOUR_ISL_LANDHEX_TYPE_3PL

private static final int[] FOUR_ISL_LANDHEX_TYPE_3PL
Four Islands: Land hex types for all 4 islands.


FOUR_ISL_LANDHEX_COORD_3PL

private static final int[] FOUR_ISL_LANDHEX_COORD_3PL
Four Islands: Land hex coordinates for all 4 islands. The 4 island land areas are given by FOUR_ISL_LANDHEX_LANDAREA_RANGES_3PL.


FOUR_ISL_DICENUM_3PL

private static final int[] FOUR_ISL_DICENUM_3PL
Four Islands: Dice numbers for all 4 islands. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOUR_ISL_LANDHEX_LANDAREA_RANGES_3PL

private static final int[] FOUR_ISL_LANDHEX_LANDAREA_RANGES_3PL
Four Islands: Island hex counts and land area numbers within FOUR_ISL_LANDHEX_COORD_3PL. Allows them to be defined, shuffled, and placed together.


FOUR_ISL_PORT_EDGE_FACING_3PL

private static final int[] FOUR_ISL_PORT_EDGE_FACING_3PL
Four Islands: Port edges and facings on all 4 islands. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Each port's type will be from FOUR_ISL_PORT_TYPE_3PL.


FOUR_ISL_PORT_TYPE_3PL

private static final int[] FOUR_ISL_PORT_TYPE_3PL
Four Islands: Port types on all 4 islands. OK to shuffle.


FOUR_ISL_BOARDSIZE_4PL

private static final int FOUR_ISL_BOARDSIZE_4PL
Four Islands: Board size for 4 players: Max row 0x10, max col 0x0e.

See Also:
Constant Field Values

FOUR_ISL_LANDHEX_TYPE_4PL

private static final int[] FOUR_ISL_LANDHEX_TYPE_4PL
Four Islands: Land hex types for all 4 islands.


FOUR_ISL_LANDHEX_COORD_4PL

private static final int[] FOUR_ISL_LANDHEX_COORD_4PL
Four Islands: Land hex coordinates for all 4 islands.


FOUR_ISL_DICENUM_4PL

private static final int[] FOUR_ISL_DICENUM_4PL
Four Islands: Dice numbers for hexes on all 4 islands. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOUR_ISL_LANDHEX_LANDAREA_RANGES_4PL

private static final int[] FOUR_ISL_LANDHEX_LANDAREA_RANGES_4PL
Four Islands: Island hex counts and land area numbers within FOUR_ISL_LANDHEX_COORD_4PL. Allows them to be defined, shuffled, and placed together.


FOUR_ISL_PORT_EDGE_FACING_4PL

private static final int[] FOUR_ISL_PORT_EDGE_FACING_4PL
Four Islands: Port edges and facings on all 4 islands. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Each port's type will be from FOUR_ISL_PORT_TYPE_4PL.


FOUR_ISL_PORT_TYPE_4PL

private static final int[] FOUR_ISL_PORT_TYPE_4PL
Four Islands: Port types on all 4 islands. OK to shuffle.


FOUR_ISL_BOARDSIZE_6PL

private static final int FOUR_ISL_BOARDSIZE_6PL
Four Islands: Board size for 6 players: Max row 0x10, max col 0x14.

See Also:
Constant Field Values

FOUR_ISL_LANDHEX_TYPE_6PL

private static final int[] FOUR_ISL_LANDHEX_TYPE_6PL
Six Islands: Land hex types for all 6 islands.


FOUR_ISL_LANDHEX_COORD_6PL

private static final int[] FOUR_ISL_LANDHEX_COORD_6PL
Six Islands: Land hex coordinates for all 6 islands.


FOUR_ISL_DICENUM_6PL

private static final int[] FOUR_ISL_DICENUM_6PL
Six Islands: Dice numbers for hexes on all 6 islands. Shuffled, no required path; as long as 6 and 8 aren't adjacent, all is OK.


FOUR_ISL_LANDHEX_LANDAREA_RANGES_6PL

private static final int[] FOUR_ISL_LANDHEX_LANDAREA_RANGES_6PL
Six Islands: Island hex counts and land area numbers within FOUR_ISL_LANDHEX_COORD_6PL. Allows them to be defined, shuffled, and placed together.


FOUR_ISL_PORT_EDGE_FACING_6PL

private static final int[] FOUR_ISL_PORT_EDGE_FACING_6PL
Six Islands: Port edges and facings on all 6 islands. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Each port's type will be from FOUR_ISL_PORT_TYPE_6PL.


FOUR_ISL_PORT_TYPE_6PL

private static final int[] FOUR_ISL_PORT_TYPE_6PL
Six Islands: Port types on all 6 islands. OK to shuffle.


PIR_ISL_BOARDSIZE

private static final int[] PIR_ISL_BOARDSIZE
Pirate Islands: Board size: 4 players max row 0x10, max col 0x12. 6 players max row 0x10, max col 0x16.


PIR_ISL_PIRATE_HEX

private static final int[] PIR_ISL_PIRATE_HEX
Pirate Islands: Starting pirate water hex coordinate for 4, 6 players.


PIR_ISL_LANDHEX_TYPE_MAIN

private static final int[][] PIR_ISL_LANDHEX_TYPE_MAIN
Pirate Islands: Land hex types for the large eastern starting island. Each row from west to east. These won't be shuffled.


PIR_ISL_LANDHEX_COORD_MAIN

private static final int[][] PIR_ISL_LANDHEX_COORD_MAIN
Pirate Islands: Land hex coordinates for the large eastern starting island. Indexes line up with PIR_ISL_LANDHEX_TYPE_MAIN, because they won't be shuffled.


PIR_ISL_DICENUM_MAIN

private static final int[][] PIR_ISL_DICENUM_MAIN
Pirate Islands: Dice numbers for hexes on the large eastern starting island. Will be placed along PIR_ISL_LANDHEX_COORD_MAIN.


PIR_ISL_PORT_EDGE_FACING

private static final int[][] PIR_ISL_PORT_EDGE_FACING
Pirate Islands: Port edges and facings on the large eastern starting island. Clockwise, starting at northwest corner of island. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Each port's type will be PIR_ISL_PORT_TYPE[i].


PIR_ISL_PORT_TYPE

private static final int[][] PIR_ISL_PORT_TYPE
Pirate Islands: Port types on the large eastern starting island. Will be shuffled.


PIR_ISL_LANDHEX_TYPE_PIRI

private static final int[][] PIR_ISL_LANDHEX_TYPE_PIRI
Pirate Islands: Hex land types on the several pirate islands. Only the first several have dice numbers.


PIR_ISL_LANDHEX_COORD_PIRI

private static final int[][] PIR_ISL_LANDHEX_COORD_PIRI
Pirate Islands: Land hex coordinates for the several pirate islands. Hex types for the pirate island are PIR_ISL_LANDHEX_TYPE_PIRI. Only the first several have dice numbers (PIR_ISL_DICENUM_PIRI).


PIR_ISL_DICENUM_PIRI

private static final int[][] PIR_ISL_DICENUM_PIRI
Pirate Islands: Dice numbers for the first few land hexes along PIR_ISL_LANDHEX_COORD_PIRI


PIR_ISL_PPATH

private static final int[][] PIR_ISL_PPATH
Pirate Islands: The hex-coordinate path for the Pirate Fleet; SOCBoardLarge additional part "PP". First element is the pirate starting position. piratePathIndex is already 0.


PIR_ISL_SEA_EDGES

private static final int[][][] PIR_ISL_SEA_EDGES
Pirate Islands: Sea edges legal/valid for each player to build ships directly to their Fortress. Each player has 1 array, in same player order as PIR_ISL_INIT_PIECES (given out to non-vacant players, not strictly matching player number).

Note SOCPlayer.doesTradeRouteContinuePastNode(SOCBoard, boolean, int, int, int) assumes there is just 1 legal sea edge, not 2, next to each player's free initial settlement, so it won't need to check if the ship route would branch in 2 directions there.

See getLegalSeaEdges(SOCGame, int) for how this is rearranged to be sent to active player clients as part of a SOCPotentialSettlements message, and the format of each player's array.


PIR_ISL_INIT_PIECES

private static final int[][] PIR_ISL_INIT_PIECES
Pirate Islands: Initial piece coordinates for each player, in same player order as PIR_ISL_SEA_EDGES (given out to non-vacant players, not strictly matching player number). Each player has 4 elements, starting at index 4 * playerNumber: Initial settlement node, initial ship edge, pirate fortress node, and the node on the pirate island where they are allowed to build a settlement on the way to the fortress (layout part "LS").


TTDESERT_BOARDSIZE

private static final int[] TTDESERT_BOARDSIZE
Through The Desert: Board size for 3, 4, 6 players: Each is 0xrrcc (max row, max col).


TTDESERT_PIRATE_HEX

private static final int[] TTDESERT_PIRATE_HEX
Through The Desert: Starting pirate water hex coordinate for 3, 4, 6 players.


TTDESERT_LANDHEX_TYPE_MAIN

private static final int[][] TTDESERT_LANDHEX_TYPE_MAIN
Through The Desert: Land hex types for the main island (land areas 1, 2). These will be shuffled. The main island also includes 3 or 5 deserts that aren't shuffled, so they aren't in this array.

The main island has just 1 GOLD_HEX, which will always be placed in landarea 2, the small strip of land past the desert. This is handled by makeNewBoard_placeHexes_arrangeGolds(int[], int[], String).

See Also:
TTDESERT_LANDHEX_COORD_MAIN

TTDESERT_LANDHEX_COORD_MAIN

private static final int[][] TTDESERT_LANDHEX_COORD_MAIN
Through The Desert: Land Area 1, 2: Land hex coordinates for the main island, excluding its desert strip but including the small fertile area on the desert's far side. Landarea 1 is most of the island. Landarea 2 is the small fertile strip.

See Also:
TTDESERT_LANDHEX_COORD_DESERT, TTDESERT_LANDHEX_COORD_SMALL

TTDESERT_LANDHEX_RANGES_MAIN

private static final int[][] TTDESERT_LANDHEX_RANGES_MAIN
Through The Desert: Land Areas 1, 2: Hex counts and Land area numbers for the main island, excluding its desert, within TTDESERT_LANDHEX_COORD_MAIN. Allows us to shuffle them all together within TTDESERT_LANDHEX_TYPE_MAIN. Dice numbers are TTDESERT_DICENUM_MAIN. Landarea 1 is most of the island. Landarea 2 is the small fertile strip on the other side of the desert.


TTDESERT_LANDHEX_COORD_DESERT

private static final int[][] TTDESERT_LANDHEX_COORD_DESERT
Through The Desert: Land hex coordinates for the strip of desert hexes on the main island.

See Also:
TTDESERT_LANDHEX_COORD_MAIN

TTDESERT_DICENUM_MAIN

private static final int[][] TTDESERT_DICENUM_MAIN
Through The Desert: Dice numbers for hexes on the main island, including the strip of land past the desert. Will be shuffled. Will be placed along TTDESERT_LANDHEX_COORD_MAIN.

See Also:
TTDESERT_DICENUM_SMALL

TTDESERT_PORT_EDGE_FACING

private static final int[][] TTDESERT_PORT_EDGE_FACING
Through The Desert: Port edges and facings on the main island. Clockwise, starting at northwest corner of island. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Each port's type will be TTDESERT_PORT_TYPE[i][j].


TTDESERT_PORT_TYPE

private static final int[][] TTDESERT_PORT_TYPE
Through The Desert: Port types on the main island. Will be shuffled. The small islands have no ports. Each port's edge and facing will be TTDESERT_PORT_EDGE_FACING[i][j].


TTDESERT_LANDHEX_TYPE_SMALL

private static final int[][] TTDESERT_LANDHEX_TYPE_SMALL
Through The Desert: Hex land types on the several small islands. Coordinates for these islands are TTDESERT_LANDHEX_COORD_SMALL.


TTDESERT_LANDHEX_RANGES_SMALL

private static final int[][] TTDESERT_LANDHEX_RANGES_SMALL
Through The Desert: Land Areas 3 to n: Hex counts and Land area numbers for each of the small "foreign" islands, one per island, within TTDESERT_LANDHEX_COORD_SMALL. Allows us to shuffle them all together within TTDESERT_LANDHEX_TYPE_SMALL. Dice numbers are TTDESERT_DICENUM_SMALL. Total land area count for this layout varies, will be 2 + (TTDESERT_LANDHEX_RANGES_SMALL[i].length / 2).


TTDESERT_LANDHEX_COORD_SMALL

private static final int[][] TTDESERT_LANDHEX_COORD_SMALL
Through The Desert: Land Areas 3 to n: Land hex coordinates for all of the small "foreign" islands, one LA per island. Hex types for these islands are TTDESERT_LANDHEX_TYPE_SMALL. Dice numbers are TTDESERT_DICENUM_SMALL. Land area numbers are split up via TTDESERT_LANDHEX_RANGES_SMALL.


TTDESERT_DICENUM_SMALL

private static final int[][] TTDESERT_DICENUM_SMALL
Through The Desert: Dice numbers for all the small islands (TTDESERT_LANDHEX_COORD_SMALL).

See Also:
TTDESERT_DICENUM_MAIN

FOR_TRI_BOARDSIZE

private static final int[] FOR_TRI_BOARDSIZE
Forgotten Tribe: Board size: 4 players max row 0x0E, max col 0x11. 6 players max row 0x0E, max col 0x15.


FOR_TRI_PIRATE_HEX

private static final int[] FOR_TRI_PIRATE_HEX
Forgotten Tribe: Starting pirate water hex coordinate for 4, 6 players.


FOR_TRI_LANDHEX_TYPE_MAIN

private static final int[][] FOR_TRI_LANDHEX_TYPE_MAIN
Forgotten Tribe: Land hex types for the main island. Shuffled.


FOR_TRI_LANDHEX_COORD_MAIN

private static final int[][] FOR_TRI_LANDHEX_COORD_MAIN
Forgotten Tribe: Land hex coordinates for the main island. 3 eastern-coast hexes included here which shouldn't be given too-favorable dice numbers are FOR_TRI_LANDHEX_COORD_MAIN_FAR_COASTAL.


FOR_TRI_LANDHEX_COORD_MAIN_FAR_COASTAL

private static final int[][] FOR_TRI_LANDHEX_COORD_MAIN_FAR_COASTAL
Forgotten Tribe: 3 Land hex coordinates on main island (within FOR_TRI_LANDHEX_COORD_MAIN) on the short eastern side. These shouldn't be given the favorable "red" dice numbers 6 or 8, nor 5 or 9.


FOR_TRI_DICENUM_MAIN

private static final int[][] FOR_TRI_DICENUM_MAIN
Forgotten Tribe: Dice numbers for hexes on the main island. Shuffled.


FOR_TRI_PORT_EDGE_FACING

private static final int[][] FOR_TRI_PORT_EDGE_FACING
Forgotten Tribe: Port edges and facings. There are no ports on the main island, only the surrounding islands.

Clockwise, starting at northwest corner of board. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Port types (FOR_TRI_PORT_TYPE) are shuffled.


FOR_TRI_PORT_TYPE

private static final int[][] FOR_TRI_PORT_TYPE
Forgotten Tribe: Port types; will be shuffled.


FOR_TRI_LANDHEX_TYPE_ISL

private static final int[][] FOR_TRI_LANDHEX_TYPE_ISL
Forgotten Tribe: Hex land types on the several small islands. None have dice numbers. Not shuffled; coordinates for these land hexes are FOR_TRI_LANDHEX_COORD_ISL.


FOR_TRI_LANDHEX_COORD_ISL

private static final int[][] FOR_TRI_LANDHEX_COORD_ISL
Forgotten Tribe: Land hex coordinates for the several small islands. Hex types for these small islands are FOR_TRI_LANDHEX_TYPE_ISL. None have dice numbers.


FOR_TRI_SVP_EDGES

private static final int[][] FOR_TRI_SVP_EDGES
Forgotten Tribe: Special Victory Point Edges: edge coordinates where ship placement gives an SVP. SOCBoardLarge additional part "VE".


FOR_TRI_DEV_CARD_EDGES

private static final int[][] FOR_TRI_DEV_CARD_EDGES
Forgotten Tribe: Dev Card Edges: Edge coordinates where ship placement gives a free development card. SOCBoardLarge additional part "CE".


CLVI_BOARDSIZE

private static final int[] CLVI_BOARDSIZE
Cloth Villages: Board size: 4 players max row 0x0E, max col 0x10. 6 players max row 0x0E, max col 0x14.


CLVI_PIRATE_HEX

private static final int[] CLVI_PIRATE_HEX
Cloth Villages: Starting pirate water hex coordinate for 4, 6 players.


CLVI_LANDHEX_TYPE_MAIN

private static final int[][] CLVI_LANDHEX_TYPE_MAIN
Cloth Villages: Land hex types for the main island. Shuffled.


CLVI_LANDHEX_COORD_MAIN

private static final int[][] CLVI_LANDHEX_COORD_MAIN
Cloth Villages: Land hex coordinates for the main islands.


CLVI_DICENUM_MAIN

private static final int[][] CLVI_DICENUM_MAIN
Cloth Villages: Dice numbers for hexes on the main island. Shuffled.


CLVI_PORT_EDGE_FACING

private static final int[][] CLVI_PORT_EDGE_FACING
Cloth Villages: Port edges and facings. There are no ports on the small islands, only the main ones.

West to east on each island. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Port types (CLVI_PORT_TYPE) are shuffled.


CLVI_PORT_TYPE

private static final int[][] CLVI_PORT_TYPE
Cloth Villages: Port types; will be shuffled. Port edge coordinates and facings are CLVI_PORT_EDGE_FACING.


CLVI_LANDHEX_TYPE_ISL

private static final int[][] CLVI_LANDHEX_TYPE_ISL
Cloth Villages: Hex land types on the several small middle islands, west to east. None have dice numbers. Not shuffled; coordinates for these land hexes are CLVI_LANDHEX_COORD_ISL.


CLVI_LANDHEX_COORD_ISL

private static final int[][] CLVI_LANDHEX_COORD_ISL
Cloth Villages: Land hex coordinates for the several small middle islands, west to east. Hex types for these small islands are CLVI_LANDHEX_TYPE_ISL. None have dice numbers. Each has two villages, see CLVI_CLOTH_VILLAGE_AMOUNTS_NODES_DICE.


CLVI_CLOTH_VILLAGE_AMOUNTS_NODES_DICE

private static final int[][] CLVI_CLOTH_VILLAGE_AMOUNTS_NODES_DICE
Cloth Villages: Small islands' cloth village node locations and dice numbers. Within the 4pl and 6pl subarrays: Index 0 is the board's "general supply" cloth count. Index 1 is each village's starting cloth count, from SOCVillage.STARTING_CLOTH. Further indexes are the locations and dice, paired for each village: [i] = node, [i+1] = dice number. SOCBoardLarge additional part "CV".

Each small island has two villages; the islands' coordinates are CLVI_LANDHEX_COORD_ISL.

See Also:
SOCGameOption.K_SC_CLVI, SOCBoardLarge.setVillageAndClothLayout(int[])

WOND_BOARDSIZE

private static final int[] WOND_BOARDSIZE
Wonders: Board size: 4 players max row 0x0E, max col 0x12. 6 players max row 0x10, max col 0x14 (incl ports' hexes).


WOND_LANDHEX_TYPE_MAIN

private static final int[][] WOND_LANDHEX_TYPE_MAIN
Wonders: Land hex types for the main island, excluding the desert. Shuffled.


WOND_LANDHEX_COORD_MAIN

private static final int[][] WOND_LANDHEX_COORD_MAIN
Wonders: Land hex coordinates for the main island, excluding deserts (WOND_LANDHEX_COORD_DESERT). Dice numbers (shuffled) are WOND_DICENUM_MAIN. Main part on rows 7 and 9, with outlying parts north and south. 2 hexes included here adjacent to the desert are WOND_LANDHEX_COORD_MAIN_AT_DESERT.


WOND_LANDHEX_COORD_MAIN_AT_DESERT

private static final int[][] WOND_LANDHEX_COORD_MAIN_AT_DESERT
Wonders: 2 land hex coordinates on main island (within WOND_LANDHEX_COORD_MAIN) adjacent to the deserts (WOND_LANDHEX_COORD_DESERT). These shouldn't be given the favorable "red" dice numbers 6 or 8.


WOND_LANDHEX_COORD_DESERT

private static final int[][] WOND_LANDHEX_COORD_DESERT
Wonders: Land hex coordinates for the deserts in the southwest of the main island. The rest of the main island's hexes are WOND_LANDHEX_COORD_MAIN. Main island hexes adjacent to the desert are WOND_LANDHEX_COORD_MAIN_AT_DESERT.


WOND_DICENUM_MAIN

private static final int[][] WOND_DICENUM_MAIN
Wonders: Dice numbers for hexes on the main island. Shuffled. Dice numbers for small islands are WOND_DICENUM_ISL.


WOND_PORT_EDGE_FACING

private static final int[][] WOND_PORT_EDGE_FACING
Wonders: Port edges and facings. There are no ports on the small islands, only the main one.

North to South on main island. Each port has 2 elements: Edge coordinate (0xRRCC), Port Facing.

Port Facing is the direction from the port edge, to the land hex touching it which will have 2 nodes where a port settlement/city can be built.

Port types (WOND_PORT_TYPE) are shuffled.


WOND_PORT_TYPE

private static final int[][] WOND_PORT_TYPE
Wonders: Port types; will be shuffled. Port edge coordinates and facings are WOND_PORT_EDGE_FACING.


WOND_LANDHEX_TYPE_ISL

private static final int[][] WOND_LANDHEX_TYPE_ISL
Wonders: Hex land types on the several small islands, west to east. Not shuffled; coordinates for these land hexes are WOND_LANDHEX_COORD_ISL. Dice numbers are WOND_DICENUM_ISL.


WOND_LANDHEX_COORD_ISL

private static final int[][] WOND_LANDHEX_COORD_ISL
Wonders: Land hex coordinates for the several small islands, west to east. Hex types for these small islands are WOND_LANDHEX_TYPE_ISL. Dice numbers are WOND_DICENUM_ISL.


WOND_DICENUM_ISL

private static final int[][] WOND_DICENUM_ISL
Wonders: Dice numbers for hexes on the several small islands, same order as WOND_LANDHEX_COORD_ISL. Not shuffled.


WOND_SPECIAL_NODES

private static final int[][][] WOND_SPECIAL_NODES
Wonders: Special Node locations. Subarrays for each of 3 types: Great wall at desert; great bridge at strait; no-build nodes near strait.

SOCBoardLarge additional parts "N1", "N2", "N3".

Constructor Detail

SOCBoardLargeAtServer

public SOCBoardLargeAtServer(java.util.Map<java.lang.String,SOCGameOption> gameOpts,
                             int maxPlayers,
                             IntPair boardHeightWidth)
                      throws java.lang.IllegalArgumentException
Create a new Settlers of Catan Board, with the v3 encoding. Called by SOCBoardLargeAtServer.BoardFactoryAtServer.createBoard(Map, boolean, int) to get the right board size and layout based on game options and optional SOCScenario. The board will be empty (all hexes are water, no dice numbers on any hex). The layout contents are set up later by calling makeNewBoard(Map) when the game is about to begin, see SOCBoardLarge class javadoc for how the layout is sent to clients.

Parameters:
gameOpts - Game's options if any, otherwise null
maxPlayers - Maximum players; must be 4 or 6
boardHeightWidth - Board's height and width. The constants for default size are SOCBoardLarge.BOARDHEIGHT_LARGE, SOCBoardLarge.BOARDWIDTH_LARGE.
Throws:
java.lang.IllegalArgumentException - if maxPlayers is not 4 or 6, or boardHeightWidth is null
Method Detail

drawItemFromStack

public java.lang.Integer drawItemFromStack()
Description copied from class: SOCBoardLarge
If this scenario has dev cards or items waiting to be claimed by any player, draw the next item from that stack.

This is called at server, but not at client; client instead receives messages from the server when the player claims such an item. It's declared here in SOCBoardLarge instead of SOCBoardLargeAtServer so that game methods can call it without importing the server-side class.

In _SC_FTRI, each item is a SOCDevCardConstants card type.

Overrides:
drawItemFromStack in class SOCBoardLarge
Returns:
The next item from the stack, or null if empty or unused

movePirateHexAlongPath

public int movePirateHexAlongPath(int numSteps)
                           throws java.lang.IllegalStateException
For game scenario option _SC_PIRI, move the pirate fleet's position along its path. Calls setPirateHex(newHex, true).

If the pirate fleet is already defeated (all fortresses recaptured), returns 0.

Overrides:
movePirateHexAlongPath in class SOCBoardLarge
Parameters:
numSteps - Number of steps to move along the path
Returns:
new pirate hex coordinate, or 0
Throws:
java.lang.IllegalStateException - if this board doesn't have layout part "PP" for the Pirate Path.

makeNewBoard

public void makeNewBoard(java.util.Map<java.lang.String,SOCGameOption> opts)
Shuffle the hex tiles and layout a board. Sets up land hex types, water, ports, dice numbers, Land Areas' contents, starting Land Area if any, and the legal/potential node sets (SOCBoardLarge.getLegalAndPotentialSettlements()). Sets up any Added Layout Parts such as "PP", "CE", "VE", "N1", etc.

This is called at server, but not at client; client instead calls methods such as SOCBoardLarge.setLandHexLayout(int[]) and SOCBoardLarge.setLegalAndPotentialSettlements(Collection, int, HashSet[]), see SOCBoardLarge class javadoc.

Overrides:
makeNewBoard in class SOCBoardLarge
Parameters:
opts - Game options, which may affect tile placement on board, or null. opts must be the same as passed to constructor, and thus give the same size and layout (same SOCBoard.getBoardEncodingFormat()).

makeNewBoard_placeHexes

private final void makeNewBoard_placeHexes(int[] landHexType,
                                           int[] landPath,
                                           int[] number,
                                           boolean shuffleDiceNumbers,
                                           boolean shuffleLandHexes,
                                           int landAreaNumber,
                                           boolean addToExistingLA,
                                           int maxPl,
                                           SOCGameOption optBC,
                                           java.lang.String scen)
                                    throws java.lang.IllegalStateException,
                                           java.lang.IllegalArgumentException
For makeNewBoard(Map), place the land hexes, number, and robber, after shuffling landHexType[]. Sets robberHex, contents of hexLayoutLg[] and numberLayoutLg[]. Adds to SOCBoardLarge.landHexLayout and SOCBoard.nodesOnLand. Also checks vs game option BC: Break up clumps of # or more same-type hexes/ports (for land hex resource types). If landAreaNumber != 0, also adds to SOCBoardLarge.landAreasLegalNodes.

Called from makeNewBoard(Map) at server only; client has its board layout sent from the server.

For the board layout geometry, see the SOCBoardLarge class javadoc's "Coordinate System" section.

This method does not clear out SOCBoardLarge.hexLayoutLg or SOCBoardLarge.numberLayoutLg before it starts placement. You can call it multiple times to set up multiple areas of land hexes: Call once for each land area.

If scenario requires some nodes to be removed from legal placement, after the last call to this method call makeNewBoard_removeLegalNodes(int[], int, int, boolean).

This method clears SOCBoardLarge.cachedGetLandHexCoords to null.

Parameters:
landHexType - Resource type to place into SOCBoardLarge.hexLayoutLg for each land hex; will be shuffled. Values are SOCBoard.CLAY_HEX, SOCBoard.DESERT_HEX, etc. There should be no SOCBoardLarge.FOG_HEX in here; land hexes are hidden by fog later.
landPath - Coordinates within SOCBoardLarge.hexLayoutLg (also within SOCBoardLarge.numberLayoutLg) for each land hex; same array length as landHexType[]
number - Numbers to place into SOCBoardLarge.numberLayoutLg for each land hex; array length is landHexType[].length minus 1 for each desert in landHexType[]. If only some land hexes have dice numbers, number[] can be shorter; each number[i] will be placed at landPath[i] until i >= number.length. Can be null if none of these land hexes have dice numbers.
shuffleDiceNumbers - If true, shuffle the dice numbers before placing along landPath. Also only if true, calls makeNewBoard_placeHexes_moveFrequentNumbers(int[], ArrayList, int, String) to make sure 6s, 8s aren't adjacent and gold hexes aren't on 6 or 8. number[] must not be null.
shuffleLandHexes - If true, shuffle landHexType[] before placing along landPath.
landAreaNumber - 0 unless there will be more than 1 Land Area (group of islands). If != 0, updates SOCBoardLarge.landAreasLegalNodes[landAreaNumber] with the same nodes added to SOCBoard.nodesOnLand.
addToExistingLA - True if landAreaNumber already has hexes and nodes, and landPath[] contents should be added to it. Ignored if landAreaNumber == 0. Otherwise this should always be false, to avoid typos and cut-and-paste errors with Land Area numbers.
maxPl - For scenario boards, use 3-player or 4-player or 6-player layout? Always tests maxPl for ==6 or < 4; actual value may be 6, 4, 3, or 2.
optBC - Game option "BC" from the options for this board, or null.
scen - Game scenario, such as SOCScenario.K_SC_FTRI, or ""; some scenarios might want special distribution of certain hex types or dice numbers. Handled via makeNewBoard_placeHexes_moveFrequentNumbers(int[], ArrayList, int, String).
Throws:
java.lang.IllegalStateException - if landAreaNumber != 0 and either SOCBoardLarge.landAreasLegalNodes == null, or not long enough, or SOCBoardLarge.landAreasLegalNodes[landAreaNumber] != null because the land area has already been placed. To avoid this exception if the second placement is deliberate, call with addToExistingLA true.
java.lang.IllegalArgumentException - if landHexType contains SOCBoardLarge.FOG_HEX, or if landHexType.length != landPath.length.
See Also:
makeNewBoard_placeHexes(int[], int[], int[], boolean, boolean, int[], boolean, int, SOCGameOption, String)

makeNewBoard_placeHexes

private final void makeNewBoard_placeHexes(int[] landHexType,
                                           int[] landPath,
                                           int[] number,
                                           boolean shuffleDiceNumbers,
                                           boolean shuffleLandHexes,
                                           int[] landAreaPathRanges,
                                           boolean addToExistingLA,
                                           int maxPl,
                                           SOCGameOption optBC,
                                           java.lang.String scen)
                                    throws java.lang.IllegalStateException,
                                           java.lang.IllegalArgumentException
For makeNewBoard(Map), place the land hexes, number, and robber for multiple land areas, after shuffling their common landHexType[]. Sets robberHex, contents of hexLayoutLg[] and numberLayoutLg[]. Adds to SOCBoardLarge.landHexLayout and SOCBoard.nodesOnLand. Also checks vs game option BC: Break up clumps of # or more same-type hexes/ports (for land hex resource types). If Land Area Number != 0, also adds to SOCBoardLarge.landAreasLegalNodes.

Called from makeNewBoard(Map) at server only; client has its board layout sent from the server.

This method does not clear out SOCBoardLarge.hexLayoutLg or SOCBoardLarge.numberLayoutLg before it starts placement. You can call it multiple times to set up multiple areas of land hexes: Call once for each group of Land Areas which shares a landPath and landHexType. For each land area, it updates SOCBoardLarge.landAreasLegalNodes[landAreaNumber] with the same nodes added to SOCBoard.nodesOnLand.

If only some parts of a Land Area should be shuffled: Call once with the hex coordinates of the shuffled part, with shuffleDiceNumbers and/or shuffleLandHexes true. Then, call again with the coordinates of the non-shuffled hexes, with shuffleLandHexes false and addToExistingLA true.

If part of the board will be hidden by SOCBoardLarge.FOG_HEX, wait before doing that: This method must shuffle and place the unobscured land hexes. After the last call to makeNewBoard_placeHexes, call makeNewBoard_hideHexesInFog(int[]).

If scenario requires some nodes to be removed from legal placement, after the last call to this method call makeNewBoard_removeLegalNodes(int[], int, int, boolean).

This method clears SOCBoardLarge.cachedGetLandHexCoords to null.

Parameters:
landHexType - Resource type to place into SOCBoardLarge.hexLayoutLg for each land hex; will be shuffled. Values are SOCBoard.CLAY_HEX, SOCBoard.DESERT_HEX, etc. There should be no SOCBoardLarge.FOG_HEX in here; land hexes are hidden by fog later. For the Fog Island (scenario option _SC_FOG), one land area contains some water. So, landHexType[] may contain SOCBoard.WATER_HEX.
landPath - Coordinates within SOCBoardLarge.hexLayoutLg (also within SOCBoardLarge.numberLayoutLg) for each hex to place; same array length as landHexType[]. May contain WATER_HEX.
landAreaPathRanges[] tells how to split this array of hex coordinates into multiple Land Areas.
number - Numbers to place into SOCBoardLarge.numberLayoutLg for each land hex; array length is landHexType[].length minus 1 for each desert or water in landHexType[] if every land hex has a dice number. If only some land hexes have dice numbers, number[] can be shorter; each number[i] will be placed at landPath[i] until i >= number.length. Can be null if none of these land hexes have dice numbers.
shuffleDiceNumbers - If true, shuffle the dice numbers before placing along landPath. number[] must not be null.
shuffleLandHexes - If true, shuffle landHexType[] before placing along landPath.
landAreaPathRanges - landPath[]'s Land Area Numbers, and the size of each land area. Array length is 2 x the count of land areas included. Index 0 is the first landAreaNumber, index 1 is the length of that land area (number of hexes). Index 2 is the next landAreaNumber, index 3 is that one's length, etc. The sum of those lengths must equal landPath.length. Use landarea number 0 for hexes which will not have a land area.
addToExistingLA - True if the land area number already has hexes and nodes, and landPath[] contents should be added to it. Ignored if land area number == 0. Otherwise this should always be false, to avoid typos and cut-and-paste errors with Land Area numbers.
maxPl - For scenario boards, use 3-player or 4-player or 6-player layout? Always tests maxPl for ==6 or < 4; actual value may be 6, 4, 3, or 2.
optBC - Game option "BC" from the options for this board, or null.
scen - Game scenario, such as SOCScenario.K_SC_FTRI, or ""; some scenarios might want special distribution of certain hex types or dice numbers. Handled via makeNewBoard_placeHexes_moveFrequentNumbers(int[], ArrayList, int, String).
Throws:
java.lang.IllegalStateException - if land area number != 0 and either SOCBoardLarge.landAreasLegalNodes == null, or not long enough, or any SOCBoardLarge.landAreasLegalNodes[landAreaNumber] != null because the land area has already been placed. To avoid this exception if the second placement is deliberate, call with addToExistingLA true.
java.lang.IllegalArgumentException - if landAreaPathRanges is null or has an uneven length,
or if the total length of its land areas != landPath.length,
or if landHexType.length != landPath.length,
or if landHexType contains SOCBoardLarge.FOG_HEX,
or if SOCBoard.makeNewBoard_checkLandHexResourceClumps(Vector, int) finds an invalid or uninitialized hex coordinate (hex type -1)
See Also:
makeNewBoard_placeHexes(int[], int[], int[], boolean, boolean, int, boolean, int, SOCGameOption, String)

makeNewBoard_placeHexes_arrangeGolds

private final void makeNewBoard_placeHexes_arrangeGolds(int[] hexCoords,
                                                        int[] landAreaPathRanges,
                                                        java.lang.String scen)
For makeNewBoard(Map), after placing land hexes and dice numbers into SOCBoardLarge.hexLayoutLg, fine-tune the randomized gold hex placement:

Parameters:
hexCoords - All hex coordinates being shuffled; includes gold hexes and non-gold hexes, may include water
landAreaPathRanges - landPath[]'s Land Area Numbers, and the size of each land area; see this parameter's javadoc at makeNewBoard_placeHexes(int[], int[], int[], boolean, boolean, int[], boolean, int, SOCGameOption, String).
scen - Game scenario, such as SOCScenario.K_SC_TTD, or ""; some scenarios might want special distribution of certain hex types or dice numbers.

makeNewBoard_placeHexes_arrGolds_addToAdjacList

private final int makeNewBoard_placeHexes_arrGolds_addToAdjacList(java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> goldAdjacGold,
                                                                  java.lang.Integer hex0,
                                                                  java.lang.Integer hex1)
Add hex1 to hex0's adjacency list in this map; create that list if needed. Used by makeNewBoard_placeHexes_arrangeGolds.

Parameters:
goldAdjacGold - Map from gold hexes to their adjacent gold hexes
hex0 - Hex coordinate that will have a list of adjacents in goldAdjacGold
hex1 - Hex coordinate to add to hex0's list
Returns:
length of hex0's list after adding hex1

makeNewBoard_placeHexes_arrGolds_swapWithRandom

private final void makeNewBoard_placeHexes_arrGolds_swapWithRandom(java.lang.Integer goldHex,
                                                                   java.util.HashSet<java.lang.Integer> nonAdjac,
                                                                   java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> goldAdjacGold)
                                                            throws java.lang.IllegalArgumentException
Swap this gold hex with a random non-adjacent hex in hexLayoutLg. Updates nonAdjac and goldAdjacGold. Used by makeNewBoard_placeHexes_arrangeGolds.

Parameters:
goldHex - Coordinate of gold hex to swap
nonAdjac - All land hexes not currently adjacent to a gold hex; should not include coordinates of any WATER_HEX
goldAdjacGold - Map of golds adjacent to each other
Throws:
java.lang.IllegalArgumentException - if goldHex coordinates in hexLayoutLg aren't GOLD_HEX

makeNewBoard_placeHexes_moveFrequentNumbers

private final boolean makeNewBoard_placeHexes_moveFrequentNumbers(int[] landPath,
                                                                  java.util.ArrayList<java.lang.Integer> redHexes,
                                                                  int maxPl,
                                                                  java.lang.String scen)
                                                           throws java.lang.IllegalStateException
For makeNewBoard(Map), after placing land hexes and dice numbers into hexLayoutLg and numberLayoutLg, separate adjacent "red numbers" (6s, 8s) and make sure gold hex dice aren't too frequent. For algorithm details, see comments in this method and makeNewBoard_placeHexes_moveFrequentNumbers_checkSpecialHexes(int[], ArrayList, int, String).

Call makeNewBoard_placeHexes_arrangeGolds(int[], int[], String) before this method, not after, so that gold hexes will already be in their final locations.

If using SOCBoardLarge.FOG_HEX, no fog should be on the board when calling this method: Don't call after makeNewBoard_hideHexesInFog(int[]).

Parameters:
landPath - Final coordinates for each hex being placed; may contain water
redHexes - Hex coordinates of placed "red" (frequent) dice numbers (6s, 8s)
maxPl - For scenario boards, use 3-player or 4-player or 6-player layout? Always tests maxPl for ==6 or < 4; actual value may be 6, 4, 3, or 2.
scen - Game scenario, such as SOCScenario.K_SC_4ISL, or ""; some scenarios might want special distribution of certain hex types or dice numbers. Currently recognized here: SOCScenario.K_SC_FTRI, SOCScenario.K_SC_WOND.
Returns:
true if able to move all adjacent frequent numbers, false if some are still adjacent.
Throws:
java.lang.IllegalStateException - if a SOCBoardLarge.FOG_HEX is found

makeNewBoard_placeHexes_moveFrequentNumbers_buildArrays

private final void makeNewBoard_placeHexes_moveFrequentNumbers_buildArrays(int[] landPath,
                                                                           java.util.ArrayList<java.lang.Integer> redHexes,
                                                                           java.util.HashSet<java.lang.Integer> ignoreHexes,
                                                                           java.util.HashSet<java.lang.Integer> otherCoastalHexes,
                                                                           java.util.HashSet<java.lang.Integer> otherHexes,
                                                                           java.lang.String scen,
                                                                           java.util.HashSet<java.lang.Integer> otherHexesForScen)
                                                                    throws java.lang.IllegalStateException
Build sets used for makeNewBoard_placeHexes_moveFrequentNumbers(int[], ArrayList, int, String). Together, otherCoastalHexes and otherHexes are all land hexes in landPath not adjacent to redHexes. otherCoastalHexes holds ones at the edge of the board, which have fewer adjacent land hexes, and thus less chance of taking up the last available non-adjacent places. Water, desert, and gold hexes won't be added to either set.

Parameters:
landPath - Coordinates for each hex being placed; may contain water
redHexes - Hex coordinates of placed "red" (frequent) dice numbers (6s, 8s)
ignoreHexes - Hex coordinates to ignore in adjacency checks while building otherCoastalHexes and otherHexes and to leave out of those sets, or null. Used only in certain scenarios where any red number on these hexes will definitely be moved elsewhere.
otherCoastalHexes - Empty set to build here
otherHexes - Empty set to build here
scen - Game scenario, such as SOCScenario.K_SC_4ISL, or "" or null; some scenarios might want special distribution of certain hex types or dice numbers.
Currently recognized here:
  • SOCScenario.K_SC_FTRI - Build a set of hexes from landPath which have a dice number other than 5, 6, 8, or 9, excluding ignoreHexes
otherHexesForScen - Empty set to build here for some scenarios, see scen for list and details; normally this parameter is null
Throws:
java.lang.IllegalStateException - if a SOCBoardLarge.FOG_HEX is found

makeNewBoard_placeHexes_moveFrequentNumbers_checkSpecialHexes

private java.util.HashSet<java.lang.Integer> makeNewBoard_placeHexes_moveFrequentNumbers_checkSpecialHexes(int[] landPath,
                                                                                                           java.util.ArrayList<java.lang.Integer> redHexes,
                                                                                                           int maxPl,
                                                                                                           java.lang.String scen)
Check for any hexes that forbid too-frequent dice numbers (only a few scenarios). These will be at most 2 or 3 hexes; try once to move any that are found. These hexes' coordinates, if any, are returned so that later parts of makeNewBoard_placeHexes_moveFrequentNumbers(int[], ArrayList, int, String) won't move any red numbers back onto them.

Parameters:
landPath - Coordinates for each hex being placed; may contain water
redHexes - Hex coordinates of placed "red" (frequent) dice numbers (6s, 8s); updated here if anything is moved.
maxPl - For scenario boards, use 3-player or 4-player or 6-player layout? Always tests maxPl for ==6 or < 4; actual value may be 6, 4, 3, or 2.
scen - Game scenario, such as SOCScenario.K_SC_FTRI, or ""; some scenarios might want special distribution of certain hex types or dice numbers. Currently recognized here: SOCScenario.K_SC_FTRI, SOCScenario.K_SC_WOND.
Returns:
Scenario's set of hexes which shouldn't contain red numbers, or null

makeNewBoard_placeHexes_moveFrequentNumbers_swapOne

private final IntTriple makeNewBoard_placeHexes_moveFrequentNumbers_swapOne(int swaphex,
                                                                            int swapi,
                                                                            java.util.ArrayList<java.lang.Integer> redHexes,
                                                                            java.util.HashSet<java.lang.Integer> ignoreHexes,
                                                                            java.util.HashSet<java.lang.Integer> otherCoastalHexes,
                                                                            java.util.HashSet<java.lang.Integer> otherHexes)
The dice-number swapping algorithm for makeNewBoard_placeHexes_moveFrequentNumbers(int[], ArrayList, int, String). If we can, pick a hex in otherCoastalHexes or otherHexes, swap and remove swaphex from redHexes, then remove/add hexes from/to otherCoastalHexes, otherHexes, redHexes. See comments for details.

This method's primary use case is un-clumping "red" dice numbers by moving them to other hexes from otherCoastalHexes or otherHexes, and updating related sets and data structures. It can also swap non-red dice number hexes with random hexes from a single set instead of those two. If calling for that, set otherHexes to null; if swaphex isn't a member of redHexes, use -1 for swapi. When otherHexes is null, the hexes adjacent to swaphex will never be added to otherCoastalHexes, but the new location of a red number and its adjacent hexes will still be removed from otherCoastalHexes.

Parameters:
swaphex - Hex coordinate with a frequent number that needs to be swapped. Must not be a member of otherCoastalHexes or otherHexes.
swapi - Index of swaphex within redHexes; this is for convenience because the caller is iterating through redHexes, and this method might remove elements below swapi. See return value "index delta". If swaphex isn't a red number and isn't in redHexes, use -1.
redHexes - Hex coordinates of placed "red" (frequent) dice numbers. Treated here as a worklist for the caller: The old location swapHex is removed from redHexes, and its adjacents might also be removed if they no longer have adjacent reds and so don't need to be moved. The new location isn't added to redHexes.
ignoreHexes - Hex coordinates to never add to otherCoastalHexes or otherHexes, or null. Used only in certain scenarios where any red number or 5 or 9 on these hexes has been moved elsewhere, and no dice number should be swapped with it. No hex that's a member of ignoreHexes may be a member of otherCoastalHexes or otherHexes when called.
otherCoastalHexes - Land hexes not adjacent to "red" numbers, at the edge of the island, for swapping dice numbers. Coastal hexes have fewer adjacent land hexes, and thus less chance of taking up the last available non-adjacent places when swapped. Should not contain gold, desert, or water hexes. Swap locations are randomly chosen from this set unless empty.
otherHexes - Land hexes not adjacent to "red" numbers, not at the edge of the island. Should not contain gold, desert, or water hexes. Can be null.
Returns:
The old frequent-number hex coordinate, its swapped coordinate, and the "index delta", or null if nothing was available to swap. If the "index delta" != 0, a hex at redHexes[j] was removed for at least one j < swapi, and the caller's loop iterating over redHexes[] should adjust its index (swapi) so no elements are skipped; the delta is always negative.

makeNewBoard_checkPortLocationsConsistent

private final void makeNewBoard_checkPortLocationsConsistent(int[] portsLocFacing)
                                                      throws java.lang.IllegalArgumentException
For makeNewBoard(Map), check port locations and facings, and make sure no port overlaps with a land hex. Each port's edge coordinate has 2 valid perpendicular facing directions, and ports should be on a land/water edge, facing the land side. Call this method after placing all land hexes.

Parameters:
portsLocFacing - Array of port location edges and "port facing" directions (FACING_NE = 1, etc), such as PORT_EDGE_FACING_MAINLAND_4PL. Each port has 2 consecutive elements: Edge coordinate (0xRRCC), Port Facing (towards land).
Throws:
java.lang.IllegalArgumentException - If a port's facing direction isn't possible, or its location causes its water portion to "overlap" land. Stops with the first error, doesn't keep checking other ports afterwards. The detail string will be something like:
Inconsistent layout: Port at index 2 edge 0x803 covers up land hex 0x703
Inconsistent layout: Port at index 2 edge 0x803 faces water, not land, hex 0x904
Inconsistent layout: Port at index 2 edge 0x802 facing should be NE or SW, not 3

makeNewBoard_fillNodesOnLandFromHexes

private void makeNewBoard_fillNodesOnLandFromHexes(int[] landHexCoords,
                                                   int startIdx,
                                                   int pastEndIdx,
                                                   int landAreaNumber,
                                                   boolean addToExistingLA)
                                            throws java.lang.IllegalStateException
Calculate the board's legal settlement/city nodes, based on land hexes. All corners of these hexes are legal for settlements/cities. Called from makeNewBoard_placeHexes(int[], int[], int[], boolean, boolean, int[], boolean, int, SOCGameOption, String). Can use all or part of a landHexCoords array.

Iterative: Can call multiple times, giving different hexes each time. Each call will add those hexes to SOCBoard.nodesOnLand. If landAreaNumber != 0, also adds them to SOCBoardLarge.landAreasLegalNodes. Call this method once for each land area.

Before the first call, clear nodesOnLand.

If scenario requires some nodes to be removed from legal placement, after the last call to this method call makeNewBoard_removeLegalNodes(int[], int, int, boolean).

Parameters:
landHexCoords - Coordinates of a contiguous group of land hexes. If startIdx and pastEndIdx partially use this array, only that part needs to be contiguous, the rest of landHexCoords is ignored. Any hex coordinates here which are SOCBoard.WATER_HEX are ignored.
startIdx - First index to use within landHexCoords[]; 0 if using the entire array
pastEndIdx - Just past the last index to use within landHexCoords[]; If this call uses landHexCoords up through its end, this is landHexCoords.length
landAreaNumber - 0 unless there will be more than 1 Land Area (groups of islands). If != 0, updates SOCBoardLarge.landAreasLegalNodes[landAreaNumber] with the same nodes added to SOCBoard.nodesOnLand.
addToExistingLA - True if landAreaNumber already has hexes and nodes, and landHexCoords[] contents should be added to it. Ignored if landAreaNumber == 0. Otherwise this should always be false.
Throws:
java.lang.IllegalStateException - if landAreaNumber != 0 and either SOCBoardLarge.landAreasLegalNodes == null, or not long enough, or SOCBoardLarge.landAreasLegalNodes[landAreaNumber] != null
See Also:
SOCBoardLarge.initLegalRoadsFromLandNodes(), SOCBoardLarge.initLegalShipEdges()

makeNewBoard_removeLegalNodes

private final void makeNewBoard_removeLegalNodes(int[] nodeCoords,
                                                 int landAreaNumber,
                                                 int addNodeListNumber,
                                                 boolean emptyPartAfterInitPlace)
                                          throws java.lang.IllegalArgumentException
For makeNewBoard(Map), remove some nodes from legal/potential initial placement locations. Does not remove from nodesOnLand. Used in some scenarios (_SC_WOND) after the last call to makeNewBoard_placeHexes(int[], int[], int[], boolean, boolean, int, boolean, int, SOCGameOption, String).

To re-add nodes after initial placement, call SOCBoardLarge.addLegalNodes(int[], int). This is done automatically by SOCGame.updateAtGameFirstTurn() if the nodes are in lists referenced from Added Layout Part "AL" (see parameter addNodeListNumber).

Parameters:
nodeCoords - Nodes to remove from landAreasLegalNodes [landAreaNumber] and SOCBoardLarge.getLegalAndPotentialSettlements()
landAreaNumber - Land Area to remove nodes from. If this is startingLandArea, will also remove the nodes from potential initial settlement locations.
addNodeListNumber - If != 0, these nodes will be re-added to legal locations after initial placement. Adds this node list number to Added Layout Part "AL" and calls setAddedLayoutPart("N" + addNodeListNumber, nodeCoords) to add a Layout Part such as "N1", "N2", etc. For details see "AL" in the "Other layout parts" section of the SOCBoardLayout2 message javadoc.
emptyPartAfterInitPlace - If true, the Added Layout Part ("N1", "N2", etc) is used only during initial placement, and its contents should be emptied after that
Throws:
java.lang.IllegalArgumentException - if landAreaNumber <= 0 or addNodeListNumber < 0

makeNewBoard_hideHexesInFog

protected void makeNewBoard_hideHexesInFog(int[] hexCoords)
                                    throws java.lang.IllegalStateException
For makeNewBoard(Map), hide these hexes under SOCBoardLarge.FOG_HEX to be revealed later. The hexes will be stored in SOCBoardLarge.fogHiddenHexes; their SOCBoardLarge.hexLayoutLg and SOCBoardLarge.numberLayoutLg elements will be set to SOCBoardLarge.FOG_HEX and -1. Does not remove anything from SOCBoard.nodesOnLand or SOCBoardLarge.landAreasLegalNodes.

To simplify the bot, client, and network, hexes can be hidden only during makeNewBoard, before the board layout is made and sent to the client.

Parameters:
hexCoords - Coordinates of each hex to hide in the fog
Throws:
java.lang.IllegalStateException - if any hexCoord is already SOCBoardLarge.FOG_HEX within SOCBoardLarge.hexLayoutLg
See Also:
SOCBoardLarge.revealFogHiddenHexPrep(int)

getBoardSize

private static int getBoardSize(java.util.Map<java.lang.String,SOCGameOption> gameOpts,
                                int maxPlayers)
Get the board size for BoardFactoryAtServer.createBoard: The default size BOARDHEIGHT_LARGE by BOARDWIDTH_LARGE, unless gameOpts contains a scenario ("SC") whose layout has a custom height/width. The fallback 6-player layout size is taller, BOARDHEIGHT_LARGE + 3 by BOARDWIDTH_LARGE.

Parameters:
gameOpts - Game options, or null
maxPlayers - Maximum players; must be 4 or 6
Returns:
encoded size (0xRRCC), the same format as game option "_BHW"
See Also:
SOCBoardLarge.getBoardSize(Map, int)

getLegalSeaEdges

public static final int[][] getLegalSeaEdges(SOCGame ga,
                                             int forPN)
For scenario game option _SC_PIRI, get the list of Legal Sea Edges arranged for the players not vacant. Arranged in same player order as the Lone Settlement locations in Added Layout Part "LS".

Parameters:
ga - Game data, for SOCGame.maxPlayers and SOCGame.isSeatVacant(int)
forPN - -1 for all players, or a specific player number
Returns:
Edge data from PIR_ISL_SEA_EDGES, containing either one array when forPN != -1, or an array for each player from 0 to ga.maxPlayers, where vacant players get empty subarrays of length 0.

Each player's list is their individual edge coordinates and/or ranges. Ranges are designated by a pair of positive,negative numbers: 0xC04, -0xC0D is a range of the valid edges from C04 through C0D inclusive.

If game doesn't have SOCGameOption.K_SC_PIRI, returns null.

See Also:
startGame_putInitPieces(SOCGame)

startGame_putInitPieces

public void startGame_putInitPieces(SOCGame ga)
For scenario game option _SC_PIRI, place each player's initial pieces. For _SC_FTRI, set aside some dev cards to be claimed later at Special Edges. Otherwise do nothing.

For _SC_PIRI, also calls each player's SOCPlayer.addLegalSettlement(int, boolean) for their Lone Settlement location (adds layout part "LS"). Vacant player numbers get 0 for their "LS" element.

Called only at server. For a method called during game start at server and clients, see SOCGame.updateAtBoardLayout().

Called from SOCGameHandler.startGame(SOCGame) for those scenario game options; if you need it called for your game, add a check there for your scenario's SOCGameOption.

This is called after makeNewBoard(Map) and before SOCGameHandler.getBoardLayoutMessage(soc.game.SOCGame). So if needed, it can call SOCBoardLarge.setAddedLayoutPart(String, int[]).

If ship placement is restricted by the scenario, please call each player's SOCPlayer.setRestrictedLegalShips(int[]) before calling this method, so the legal and potential arrays will be initialized.

See Also:
getLegalSeaEdges(SOCGame, int)