Class SpecificEntityTurn

All Implemented Interfaces:
Serializable, PlayerTurn
Direct Known Subclasses:
CounterGrappleTurn, TriggerAPPodTurn, TriggerBPodTurn

public class SpecificEntityTurn extends GameTurn
A type of game turn that allows only one specific entity to move.
See Also:
  • Constructor Details

    • SpecificEntityTurn

      public SpecificEntityTurn(int playerId, int entityId)
  • Method Details

    • getEntityNum

      public int getEntityNum()
    • isValidEntity

      public boolean isValidEntity(Entity entity, Game game, boolean useValidNonInfantryCheck)
      Description copied from class: GameTurn
      Determine if the specified entity is a valid one to use for this turn.

      In addition to the "standard" validity checks, there is also a check for the optional rules "infantry move later" and "ProtoMeks move later." This checks to see if those options are enabled and if there is a valid non-infantry (or proto) unit to move and if so, the entity is invalid.

      There are certain instances where this check should not be used when the optional rules are enabled (such as loading infantry into a unit). Hence, the use of these additional checks is specified by a boolean input parameter.

      Overrides:
      isValidEntity in class GameTurn
      Parameters:
      entity - the Entity that may take this turn.
      game - The Game the turn belongs to
      useValidNonInfantryCheck - Boolean that determines if we should check to see if infantry can be moved yet
      Returns:
      true if the specified entity can take this turn. false if the entity is not valid for this turn.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractPlayerTurn