Class BattleMovementServerSide


  • public class BattleMovementServerSide
    extends java.lang.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 Detail

      • game

        private final Game game
      • cumulativeSlow

        final boolean cumulativeSlow
      • oneHexAllowed

        final boolean oneHexAllowed
    • Constructor Detail

      • BattleMovementServerSide

        BattleMovementServerSide​(IOptions options,
                                 Game game)
    • Method Detail

      • findMoves

        private java.util.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 java.util.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 java.util.Set<BattleHex> showMoves​(CreatureServerSide critter,
                                                  boolean ignoreMobileAllies)
        Find all legal moves for this critter.