Class UnloadStrandedTurn

All Implemented Interfaces:
Serializable, PlayerTurn

public class UnloadStrandedTurn extends GameTurn
A type of game turn that indicates that one or more players should be given the opportunity to unload entities that are stranded on immobile transports. Each player declares which stranded units they will unload at the beginning of the movement phase, without being told what stranded units their opponent(s) are unloading.

According to Randall Bills, the "minimum move" rule allow stranded units to dismount at the start of the turn [there used to be an ancient link to a forum post here].

See Also:
  • Constructor Details

    • UnloadStrandedTurn

      public UnloadStrandedTurn(int... ids)
      Any player that owns an entity whose ID is in the past array should be given a chance to unload it.
      Parameters:
      ids - the array of int IDs of stranded entities. This value must not be null or empty.
      Throws:
      IllegalArgumentException - if a null or empty value is passed for ids.
    • UnloadStrandedTurn

      public UnloadStrandedTurn(Iterator<Entity> entities)
      Any player that owns an entity in the past enumeration should be given a chance to unload it.
      Parameters:
      entities - the Enumeration of stranded entities. This value must not be null or empty.
      Throws:
      IllegalArgumentException - if a null or empty value is passed for entities.
  • Method Details

    • getEntityIds

      public int[] getEntityIds()
    • isValidEntity

      public boolean isValidEntity(@Nullable Entity entity, Game game)
      Determine if the given entity is a valid one to use for this turn.
      Overrides:
      isValidEntity in class GameTurn
      Parameters:
      entity - the Entity being tested for the move.
      game - The Game the entity belongs to
      Returns:
      true if the entity can be moved.
    • isValid

      public boolean isValid(int playerId, @Nullable Entity entity, Game game)
      Overrides:
      isValid in class GameTurn
      Returns:
      true if the player and entity are both valid.
    • isValid

      public boolean isValid(int playerId, IGame game)
      Returns:
      true if the player is valid.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractPlayerTurn