Class SBFFormationTurn

All Implemented Interfaces:
Serializable, PlayerTurn

public class SBFFormationTurn extends SBFTurn
This is a turn for a player action that uses a unit (formation). Examples are movement and firing.
See Also:
  • Constructor Details

    • SBFFormationTurn

      public SBFFormationTurn(int playerId)
      Creates a new player turn for an SBF Game.
      Parameters:
      playerId - The player who has to take action
  • Method Details

    • isValid

      public boolean isValid(SBFGame game)
      Description copied from class: SBFTurn
      Returns true when this turn can be played given the current state of the given game. Should return false when e.g. no valid formation can be found to move for the player or the player or formation of the turn is null (e.g. because it has previously been destroyed).
      Specified by:
      isValid in class SBFTurn
      Parameters:
      game - The game object
      Returns:
      True when the turn can be played, false when it should be skipped
    • isValidEntity

      public boolean isValidEntity(InGameObject unit, IGame game)
      Returns:
      true if the given unit may act in this turn