megamek.common
Class GameTurn.UnloadStrandedTurn

java.lang.Object
  extended by megamek.common.GameTurn
      extended by megamek.common.GameTurn.UnloadStrandedTurn
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
GameTurn

public static class GameTurn.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.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class megamek.common.GameTurn
GameTurn.CounterGrappleTurn, GameTurn.EntityClassTurn, GameTurn.SpecificEntityTurn, GameTurn.TriggerAPPodTurn, GameTurn.TriggerBPodTurn, GameTurn.UnitNumberTurn, GameTurn.UnloadStrandedTurn
 
Field Summary
 
Fields inherited from class megamek.common.GameTurn
CLASS_AERO, CLASS_DROPSHIP, CLASS_GUN_EMPLACEMENT, CLASS_INFANTRY, CLASS_JUMPSHIP, CLASS_MECH, CLASS_PROTOMECH, CLASS_SMALL_CRAFT, CLASS_SPACE_STATION, CLASS_TANK, CLASS_WARSHIP
 
Constructor Summary
GameTurn.UnloadStrandedTurn(java.util.Enumeration<Entity> entities)
          Any player that owns an entity in the passed enumeration should be given a chance to unload it.
GameTurn.UnloadStrandedTurn(int[] ids)
          Any player that owns an entity whose ID is in the passed array should be given a chance to unload it.
 
Method Summary
 int[] getEntityIds()
           
 boolean isValid(int playerId, Entity entity, IGame game)
          Returns true if the player and entity are both valid.
 boolean isValid(int playerId, IGame game)
          Returns true if the player is valid.
 boolean isValidEntity(Entity entity, IGame game)
          Determine if the given entity is a valid one to use for this turn.
 java.lang.String toString()
           
 
Methods inherited from class megamek.common.GameTurn
getClassCode, getPlayerNum, setPlayerNum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GameTurn.UnloadStrandedTurn

public GameTurn.UnloadStrandedTurn(int[] ids)
Any player that owns an entity whose ID is in the passed 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.

GameTurn.UnloadStrandedTurn

public GameTurn.UnloadStrandedTurn(java.util.Enumeration<Entity> entities)
Any player that owns an entity in the passed 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 Detail

isValidEntity

public boolean isValidEntity(Entity entity,
                             IGame 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 IGame the entity belongs to
Returns:
true if the entity can be moved.

isValid

public boolean isValid(int playerId,
                       Entity entity,
                       IGame game)
Returns true if the player and entity are both valid.

Overrides:
isValid in class GameTurn

isValid

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

Overrides:
isValid in class GameTurn

toString

public java.lang.String toString()
Overrides:
toString in class GameTurn

getEntityIds

public int[] getEntityIds()