Class Movement
java.lang.Object
net.sf.colossus.game.Movement
- Direct Known Subclasses:
MovementClientSide, MovementServerSide
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static intprotected static EntrySidefindEntrySide(MasterHex hex, int cameFrom) Set the entry side relative to the hex label.findNearbyUnoccupiedHexes(MasterHex hex, Legion legion, int roll, int cameFrom) Recursively find all unoccupied hexes within roll hexes, for tower teleport.findNormalMoves(MasterHex hex, Legion legion, int roll, int block, int cameFrom, MasterHex fromHex, boolean ignoreFriends) Recursively find conventional moves from this hex.isValidEntrySide(Legion legion, MasterHex hex, boolean teleport, EntrySide entrySide) Verify whether this is a valid entry side.isValidNormalMove(Legion legion, MasterHex hex, Player player, int roll) Verify whether this is a valid normal move.isValidTeleportMove(Legion legion, MasterHex hex, int roll) Verify whether this is a valid teleport move.listAllMoves(Legion legion, MasterHex hex, int movementRoll) Return set of hexLabels describing where this legion can move.listAllMoves(Legion legion, MasterHex hex, int movementRoll, boolean inAdvance) Return set of hexLabels describing where this legion can move.listNormalMoves(Legion legion, MasterHex hex, int movementRoll) listNormalMoves(Legion legion, MasterHex hex, int movementRoll, boolean ignoreFriends, MasterHex fromHex, boolean inAdvance) Return set of hexLabels describing where this legion can move without teleporting.listPossibleEntrySides(Legion legion, MasterHex targetHex, boolean teleport) Return a Set of Strings "Left" "Right" or "Bottom" describing possible entry sides.listTeleportMoves(Legion legion, MasterHex hex, int movementRoll) Return set of hexLabels describing where this legion can teleport.listTeleportMoves(Legion legion, MasterHex hex, int movementRoll, boolean inAdvance) Return set of hexLabels describing where this legion can teleport.booleanprotected booleanprotected booleanprotected boolean
-
Field Details
-
LOGGER
-
game
-
options
-
-
Constructor Details
-
Movement
-
-
Method Details
-
findEntrySide
-
findBlock
-
findNearbyUnoccupiedHexes
-
titanTeleportAllowed
public boolean titanTeleportAllowed() -
towerTeleportAllowed
protected boolean towerTeleportAllowed() -
towerToTowerTeleportAllowed
protected boolean towerToTowerTeleportAllowed() -
towerToNonTowerTeleportAllowed
protected boolean towerToNonTowerTeleportAllowed() -
listTeleportMoves
-
listTeleportMoves
-
listPossibleEntrySides
-
listAllMoves
-
listAllMoves
-
listNormalMoves
-
listNormalMoves
public Set<MasterHex> listNormalMoves(Legion legion, MasterHex hex, int movementRoll, boolean ignoreFriends, MasterHex fromHex, boolean inAdvance) Return set of hexLabels describing where this legion can move without teleporting. Include moves currently blocked by friendly legions if ignoreFriends is true.- Returns:
- set of hexlabels
-
findNormalMoves
public Set<String> findNormalMoves(MasterHex hex, Legion legion, int roll, int block, int cameFrom, MasterHex fromHex, boolean ignoreFriends) Recursively find conventional moves from this hex. If block >= 0, go only that way. If block == -1, use arches and arrows. If block == -2, use only arrows. Do not double back in the direction you just came from. TODO get rid of this String serialization and return a proper data structure- Returns:
- a set of hexLabel:entrySide tuples.
-
isValidTeleportMove
-
isValidNormalMove
-
isValidEntrySide
Verify whether this is a valid entry side.- Parameters:
legion- The moving legionhex- The aimed target hexteleport- Whether this is a teleported move- Returns:
- Reason why it is not a valid entry side, null if valid
-