Interface PlayerTurn

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractPlayerTurn, AcTurn, CounterGrappleTurn, EntityClassTurn, FormationTurn, GameTurn, PrephaseTurn, SBFFormationTurn, SBFPlayerTurn, SBFTurn, SpecificEntityTurn, TriggerAPPodTurn, TriggerBPodTurn, UnitNumberTurn, UnloadStrandedTurn

public interface PlayerTurn extends Serializable
This interface is implemented by player turns (e.g. GameTurn), where a specific player has to declare their action(s). GameTurn is specific to Total Warfare/Entity turns.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns true if this player turn requires the player to provide actions for more than one unit.
    default boolean
    isValid(int playerId, IGame game)
     
    default boolean
    isValid(int playerId, InGameObject unit, IGame game)
     
    boolean
     
    int
     
  • Method Details

    • playerId

      int playerId()
      Returns:
      this turn's player ID
    • isValid

      default boolean isValid(int playerId, IGame game)
      Returns:
      true if the given player ID is this turn's player
    • isValidEntity

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

      default boolean isValid(int playerId, InGameObject unit, IGame game)
      Returns:
      true if the given player ID is this turn's player and the given unit may act in this turn
    • isMultiTurn

      default boolean isMultiTurn()
      Returns true if this player turn requires the player to provide actions for more than one unit. This is true for example when vehicles must be moved as a lance. This is not equivalent to providing multiple actions, such as in firing multiple weapons. That is not considered a multi-turn. By default, this method returns false.
      Returns:
      True when this turn requires actions for at least two units