Package megamek.common.interfaces
Interface PlayerTurn
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractPlayerTurn,AcTurn,CounterGrappleTurn,EntityClassTurn,FormationTurn,GameTurn,PrephaseTurn,SBFFormationTurn,SBFPlayerTurn,SBFTurn,SpecificEntityTurn,TriggerAPPodTurn,TriggerBPodTurn,UnitNumberTurn,UnloadStrandedTurn
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 TypeMethodDescriptiondefault booleanReturns true if this player turn requires the player to provide actions for more than one unit.default booleandefault booleanisValid(int playerId, InGameObject unit, IGame game) booleanisValidEntity(InGameObject unit, IGame game) intplayerId()
-
Method Details
-
playerId
int playerId()- Returns:
- this turn's player ID
-
isValid
- Returns:
- true if the given player ID is this turn's player
-
isValidEntity
- Returns:
- true if the given unit may act in this turn
-
isValid
- 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
-