|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.GameTurn
public class GameTurn
Represents a single turn within a phase of the game, where a specific player has to declare his/her action. The default game turn allows a player to move any entity.
| Nested Class Summary | |
|---|---|
static class |
GameTurn.CounterGrappleTurn
A type of game turn that allows only one specific entity to counterattack a break grapple by original attacker |
static class |
GameTurn.EntityClassTurn
A type of game turn that allows only certain types of units to move. |
static class |
GameTurn.SpecificEntityTurn
A type of game turn that allows only one specific entity to move. |
static class |
GameTurn.TriggerAPPodTurn
A type of game turn that allows only one specific entity to trigger their Anti-Personell pods against attacking infantry. |
static class |
GameTurn.TriggerBPodTurn
A type of game turn that allows only one specific entity to trigger their Anti-Battle Armor pods against attacking infantry/BA. |
static class |
GameTurn.UnitNumberTurn
A type of game turn that allows only entities belonging to certain units to move. |
static class |
GameTurn.UnloadStrandedTurn
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. |
| Field Summary | |
|---|---|
static int |
CLASS_AERO
The constant to represent Aero entities. |
static int |
CLASS_DROPSHIP
The constant to represent dropship entities. |
static int |
CLASS_GUN_EMPLACEMENT
The constant to represent Gun Emplacement entities. |
static int |
CLASS_INFANTRY
The constant to represent Infantry (and Battle Armor) entities. |
static int |
CLASS_JUMPSHIP
The constant to represent jumpship entities. |
static int |
CLASS_MECH
The constant to represent Mech entities. |
static int |
CLASS_PROTOMECH
The constant to represent Protomech entities. |
static int |
CLASS_SMALL_CRAFT
The constant to represent warship entities. |
static int |
CLASS_SPACE_STATION
The constant to represent space station entities. |
static int |
CLASS_TANK
The constant to represent Tank entities. |
static int |
CLASS_WARSHIP
The constant to represent warship entities. |
| Constructor Summary | |
|---|---|
GameTurn(int playerId)
Creates a new instance of GameTurn |
|
| Method Summary | |
|---|---|
static int |
getClassCode(Entity entity)
Get the class code for the given entity. |
int |
getPlayerNum()
|
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 specified entity is a valid one to use for this turn. |
void |
setPlayerNum(int playerId)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CLASS_INFANTRY
public static final int CLASS_PROTOMECH
public static final int CLASS_TANK
public static final int CLASS_MECH
public static final int CLASS_GUN_EMPLACEMENT
public static final int CLASS_AERO
public static final int CLASS_SPACE_STATION
public static final int CLASS_JUMPSHIP
public static final int CLASS_WARSHIP
public static final int CLASS_DROPSHIP
public static final int CLASS_SMALL_CRAFT
| Constructor Detail |
|---|
public GameTurn(int playerId)
| Method Detail |
|---|
public int getPlayerNum()
public void setPlayerNum(int playerId)
public boolean isValidEntity(Entity entity,
IGame game)
entity - the Entity that may take this turn.game - the IGame this turn belongs to.
true if the specified entity can take this turn.
false if the entity is not valid for this turn.
public boolean isValid(int playerId,
Entity entity,
IGame game)
public boolean isValid(int playerId,
IGame game)
public java.lang.String toString()
toString in class java.lang.Objectpublic static int getClassCode(Entity entity)
entity - the Entity whose class code is needed.
int code for the entity's class.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||