Class BattleMovementServerSide

java.lang.Object
net.sf.colossus.server.BattleMovementServerSide

public class BattleMovementServerSide extends Object
This holds currently the BattleMovement related methods that has been so far part of BattleServerSide. TODO Further clean up, and unify with client.BattleMovement, and eventually move up to game. The client side version is in better shape, but some of the methods it uses from "game" package classes are abstract in game package and in server package classes they are only dummies!
Author:
David Ripton (BattleServerSide), Romain Dolbeau (BattleServerSide), Clemens Katzer
  • Field Details

    • game

      private final Game game
    • cumulativeSlow

      final boolean cumulativeSlow
    • oneHexAllowed

      final boolean oneHexAllowed
  • Constructor Details

    • BattleMovementServerSide

      BattleMovementServerSide(IOptions options, Game game)
  • Method Details

    • findMoves

      private Set<BattleHex> findMoves(BattleHex hex, CreatureServerSide critter, boolean flies, int movesLeft, int cameFrom, boolean ignoreMobileAllies, boolean first)
      Recursively find moves from this hex. Return a set of string hex IDs for all legal destinations. Do not double back. If ignoreMobileAllies is true, pretend that allied creatures that can move out of the way are not there.
    • findUnoccupiedStartlistHexes

      private Set<BattleHex> findUnoccupiedStartlistHexes(boolean ignoreMobileAllies, MasterBoardTerrain terrain)
      This method is called by the defender on turn 1 in a Startlisted Terrain, so we know that there are no enemies on board, and all allies are mobile.
    • showMoves

      public Set<BattleHex> showMoves(CreatureServerSide critter, boolean ignoreMobileAllies)
      Find all legal moves for this critter.
    • getBattleSS

      BattleServerSide getBattleSS()