Package megamek.common.units
Class UnitNumberTurn
java.lang.Object
megamek.common.game.AbstractPlayerTurn
megamek.common.game.GameTurn
megamek.common.units.UnitNumberTurn
- All Implemented Interfaces:
- Serializable,- PlayerTurn
A type of game turn that allows only entities belonging to certain units to move.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionUnitNumberTurn(int playerId, short unit) Only allow entities for the given player which have types in the class mask to move.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanisValidEntity(Entity entity, Game game, boolean useValidNonInfantryCheck) Determine if the specified entity is a valid one to use for this turn.Methods inherited from class megamek.common.game.GameTurnisMultiTurn, isValid, isValidEntity, isValidEntity, setMultiTurnMethods inherited from class megamek.common.game.AbstractPlayerTurnplayerId, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.interfaces.PlayerTurnisValid, isValid
- 
Constructor Details- 
UnitNumberTurnpublic UnitNumberTurn(int playerId, short unit) Only allow entities for the given player which have types in the class mask to move.- Parameters:
- playerId- the- intID of the player
- unit- the- intunit number of the entities allowed to move.
 
 
- 
- 
Method Details- 
isValidEntityDescription copied from class:GameTurnDetermine 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:
- isValidEntityin class- GameTurn
- Parameters:
- entity- the- Entitythat may take this turn.
- game- The- Gamethe 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 is a valid one to use for this turn.
 
 
-