|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.common.Game
public class Game
The game class is the root of all data about the game in progress. Both the Client and the Server should have one of these objects and it is their job to keep it synched.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface megamek.common.IGame |
|---|
IGame.Phase |
| Field Summary | |
|---|---|
IBoard |
board
|
(package private) java.util.Vector<Entity> |
vOutOfGame
Track entities removed from the game (probably by death) |
| Constructor Summary | |
|---|---|
Game()
Constructor |
|
| Method Summary | |
|---|---|
int |
actionsSize()
|
void |
addAction(EntityAction ea)
Adds the specified action to the actions list for this phase. |
void |
addAttack(AttackHandler ah)
add an AttackHandler to the attacks list |
void |
addCharge(AttackAction ea)
Adds a pending displacement attack to the list for this phase. |
void |
addControlRoll(PilotingRollData control)
Adds a pending Control roll to the list for this phase. |
void |
addEntity(int id,
Entity entity)
|
void |
addExtremeGravityPSR(PilotingRollData psr)
Adds a pending extreme Gravity PSR to the list for this phase. |
void |
addFlare(Flare flare)
Add a new flare |
void |
addGameListener(GameListener listener)
Adds the specified game listener to receive board events from this board. |
void |
addInitiativeRerollRequest(Team t)
|
void |
addMinefield(Minefield mf)
Addds the specified minefield |
protected void |
addMinefieldHelper(Minefield mf)
|
void |
addMinefields(java.util.Vector<Minefield> mines)
Adds a number of minefields |
void |
addPlayer(int id,
Player player)
|
void |
addPSR(PilotingRollData psr)
Adds a pending PSR to the list for this phase. |
void |
addRam(AttackAction ea)
Adds a pending ramming attack to the list for this phase. |
void |
addReports(java.util.Vector<Report> v)
Adds the given reports vector to the GameReport collection. |
void |
addSmokeCloud(SmokeCloud cloud)
add a smoke cloud to the list of smoke clouds |
void |
addTagInfo(TagInfo info)
add the results of one tag attack |
void |
addTeleMissileAttack(AttackAction ea)
Adds a pending ramming attack to the list for this phase. |
void |
addVibrabomb(Minefield mf)
Addds the specified vibrabomb |
java.util.Vector<Report> |
ageFlares()
Age the flare list and remove any which have burnt out Artillery flares drift with wind. |
GameTurn |
changeToNextTurn()
Changes to the next turn, returning it. |
void |
checkForCompleteDeployment()
Checks to see if we've past our deployment completion |
boolean |
checkForMagneticClamp()
Check each player for the presence of a Battle Armor squad equipped with a Magnetic Clamp. |
boolean |
checkForValidDropships(int playerId)
|
boolean |
checkForValidJumpships(int playerId)
|
boolean |
checkForValidNonInfantryAndOrProtomechs(int playerId)
Returns true if the player has any valid units this turn that are not infantry, not protomechs, or not either of those. |
boolean |
checkForValidSmallCraft(int playerId)
|
boolean |
checkForValidSpaceStations(int playerId)
A set of checks for aero units to make sure that the movement order is maintained |
boolean |
checkForValidWarships(int playerId)
|
void |
clearAllReports()
Clears out all the current reports, paving the way for a new game. |
void |
clearDeploymentThisRound()
Clear this round from this list of entities to deploy |
void |
clearMinefields()
Removes all minefields |
protected void |
clearMinefieldsHelper()
|
void |
clearTagInfoShots(Entity ae,
Coords tc)
clears the "shots" attribute of all TagInfos where attacker is on same team as ae and target is on same mapsheet as tc |
boolean |
containsMinefield(Coords coords)
Check if there is a minefield at given coords |
boolean |
containsVibrabomb(Minefield mf)
Checks if the game contains the specified Vibrabomb |
void |
createVictoryConditions()
use victoryfactory to generate a new victorycondition checker provided that the victorycontext is saved properly, calling this method at any time is ok and should not affect anything unless the victorycondition-configoptions have changed. |
void |
end(int winner,
int winnerTeam)
|
boolean |
gameTimerIsExpired()
|
java.util.Enumeration<EntityAction> |
getActions()
Returns an Enumeration of actions scheduled for this phase. |
java.util.Vector<EntityAction> |
getActionsVector()
Returns the actions vector. |
Entity |
getAffaTarget(Coords c,
Entity ignore)
Returns a Target for an Accidental Fall From above, or null if no possible target is there |
int |
getAllEntitiesOwnedBy(Player player)
Returns the number of entities owned by the player, regardless of their status. |
java.util.Vector<java.util.Vector<Report>> |
getAllReports()
Returns a vector of all the reports. |
java.util.Enumeration<ArtilleryAttackAction> |
getArtilleryAttacks()
|
int |
getArtillerySize()
|
java.util.Enumeration<AttackHandler> |
getAttacks()
get the attacks |
java.util.Vector<AttackHandler> |
getAttacksVector()
get the attacks vector |
IBoard |
getBoard()
|
java.util.Vector<Entity> |
getC3NetworkMembers(Entity entity)
Returns a Vector containing the Entitys
that are in the same C3 network as the passed-in unit. |
java.util.Vector<Entity> |
getC3SubNetworkMembers(Entity entity)
Returns a Vector containing the Entitys
that are in the C3 sub-network under the passed-in unit. |
java.util.Enumeration<AttackAction> |
getCharges()
Returns an Enumeration of displacement attacks scheduled for the end of the physical phase. |
java.util.Vector<AttackAction> |
getChargesVector()
Returns the charges vector. |
java.util.Enumeration<PilotingRollData> |
getControlRolls()
Returns an Enumeration of pending Control rolls. |
java.util.Enumeration<Entity> |
getDevastatedEntities()
Returns an enumeration of entities that were utterly destroyed |
java.util.Enumeration<Entity> |
getEnemyEntities(Coords c,
Entity currentEntity)
Returns an Enumeration of the enemy's active entities at
the given coordinates. |
java.util.Enumeration<Entity> |
getEntities()
Returns an enumeration of all the entites in the game. |
java.util.Enumeration<Entity> |
getEntities(Coords c)
Returns an Enumeration of the active entities at the given coordinates. |
int |
getEntitiesOwnedBy(Player player)
Returns the number of entities owned by the player, regardless of their status, as long as they are in the game. |
java.util.Vector<Entity> |
getEntitiesVector()
Returns the actual vector for the entities |
java.util.Vector<Entity> |
getEntitiesVector(Coords c)
Return a Vector of Entites at Coords c |
Entity |
getEntity(int id)
Returns the entity with the given id number, if any. |
int |
getExternalGameId()
|
java.util.Enumeration<PilotingRollData> |
getExtremeGravityPSRs()
Returns an Enumeration of pending extreme GravityPSRs. |
int |
getFirstDeployableEntityNum()
Returns the number of the first deployable entity |
int |
getFirstDeployableEntityNum(GameTurn turn)
|
Entity |
getFirstEnemyEntity(Coords c,
Entity currentEntity)
Returns the first enemy entity at the given coordinate, if any. |
Entity |
getFirstEntity()
Returns the first entity that can act in the present turn, or null if none can. |
Entity |
getFirstEntity(Coords c)
Returns the first entity at the given coordinate, if any. |
Entity |
getFirstEntity(GameTurn turn)
Returns the first entity that can act in the specified turn, or null if none can.33 |
int |
getFirstEntityNum()
Returns the id of the first entity that can act in the current turn, or -1 if none can. |
int |
getFirstEntityNum(GameTurn turn)
Returns the id of the first entity that can act in the specified turn, or -1 if none can. |
java.util.Vector<Flare> |
getFlares()
Get a list of flares |
java.util.Enumeration<Entity> |
getFriendlyEntities(Coords c,
Entity currentEntity)
Returns an Enumeration of friendly active entities at the
given coordinates. |
java.util.Vector<GameListener> |
getGameListeners()
Returns all the GameListeners. |
java.util.Enumeration<Entity> |
getGraveyardEntities()
Returns an enumeration of salvagable entities. |
java.util.Vector<GunEmplacement> |
getGunEmplacements(Coords c)
Return a Vector of gun emplacements at Coords c |
int |
getInfantryLeft(int playerId)
Returns the number of remaining selectable infantry owned by a player. |
IGame.Phase |
getLastPhase()
|
int |
getLiveCommandersOwnedBy(Player player)
Returns the number of non-destroyed deployed entities owned by the player. |
int |
getLiveDeployedEntitiesOwnedBy(Player player)
Returns the number of non-destroyed entities owned by the player, including entities not yet deployed. |
int |
getLiveEntitiesOwnedBy(Player player)
Returns the number of non-destroyed entityes owned by the player |
java.util.Enumeration<Coords> |
getMinedCoords()
Get the coordinates of all mined hexes in the game. |
java.util.Vector<Minefield> |
getMinefields(Coords coords)
Get the minefields at specified coords |
int |
getNbrMinefields(Coords coords)
Get the number of the minefields at specified coords |
java.util.Enumeration<Entity> |
getNemesisTargets(Entity attacker,
Coords target)
Get Entities that have have a iNarc Nemesis pod attached and are situated between two Coords |
int |
getNextDeployableEntityNum(GameTurn turn,
int start)
|
int |
getNextDeployableEntityNum(int entityId)
Returns the number of the next deployable entity |
Entity |
getNextEntity(int start)
Returns the next selectable entity that can act this turn, or null if none can. |
Entity |
getNextEntityFromList(Entity current)
Returns the next entity from the master list of entities. |
int |
getNextEntityId()
|
int |
getNextEntityNum(GameTurn turn,
int start)
Returns the entity id of the next entity that can move during the specified |
int |
getNextEntityNum(int start)
Returns the next selectable entity ID that can act this turn, or null if none can. |
int |
getNoOfEntities()
Return the current number of entities in the game. |
int |
getNoOfInitiativeRerollRequests()
|
int |
getNoOfPlayers()
Return the current number of active players in the game. |
int |
getNoOfTeams()
Return the current number of teams in the game. |
GameOptions |
getOptions()
|
java.util.Vector<Entity> |
getOutOfGameEntitiesVector()
Returns the actual vector for the out-of-game entities |
Entity |
getOutOfGameEntity(int id)
Returns an out-of-game entity. |
IGame.Phase |
getPhase()
|
PlanetaryConditions |
getPlanetaryConditions()
|
Player |
getPlayer(int id)
Returns the individual player assigned the id parameter. |
java.util.ArrayList<Entity> |
getPlayerEntities(Player player,
boolean hide)
Get the entities for the player. |
java.util.Enumeration<Player> |
getPlayers()
Return an enumeration of player in the game |
java.util.Vector<Player> |
getPlayersVector()
Return the players vector |
java.util.Hashtable<Coords,java.util.Vector<Entity>> |
getPositionMap()
Returns a Hashtable that maps the Coords of
each unit in this Game to a Vector of
Entitys at that positions. |
Entity |
getPreviousEntityFromList(Entity current)
Returns the previous entity from the master list of entities. |
int |
getProtomechsLeft(int playerId)
Returns the number of remaining selectable Protomechs owned by a player. |
java.util.Enumeration<PilotingRollData> |
getPSRs()
Returns an Enumeration of pending PSRs. |
java.util.Enumeration<AttackAction> |
getRams()
Returns an Enumeration of ramming attacks scheduled for the end of the physical phase. |
java.util.Vector<AttackAction> |
getRamsVector()
Returns the rams vector. |
java.util.Vector<Report> |
getReports(int r)
Returns a vector of reports for the given round. |
java.util.Enumeration<Entity> |
getRetreatedEntities()
Returns an enumeration of entities that have retreated |
int |
getRoundCount()
Getter for property roundCount. |
java.util.Enumeration<Entity> |
getSelectedEntities(EntitySelector selector)
Get all Entitys that pass the given selection criteria. |
int |
getSelectedEntityCount(EntitySelector selector)
Count all Entitys that pass the given selection criteria. |
java.util.Enumeration<Entity> |
getSelectedOutOfGameEntities(EntitySelector selector)
Get all out-of-game Entitys that pass the given selection
criteria. |
int |
getSelectedOutOfGameEntityCount(EntitySelector selector)
Count all out-of-game Entitys that pass the given
selection criteria. |
java.util.List<SmokeCloud> |
getSmokeCloudList()
get the list of smokeclouds |
java.util.Vector<TagInfo> |
getTagInfo()
Returns this turn's tag information |
Targetable |
getTarget(int nType,
int nID)
Returns the appropriate target for this game given a type and id |
Team |
getTeamForPlayer(Player p)
Return a players team Note: may return null if player has no team |
java.util.Enumeration<Team> |
getTeams()
Return an enumeration of teams in the game |
java.util.Vector<Team> |
getTeamsVector()
This returns a clone of the vector of teams. |
java.util.Enumeration<AttackAction> |
getTeleMissileAttacks()
Returns an Enumeration of ramming attacks scheduled for the end of the physical phase. |
java.util.Vector<AttackAction> |
getTeleMissileAttacksVector()
Returns the rams vector. |
GameTurn |
getTurn()
Returns the current GameTurn object |
GameTurn |
getTurnForPlayer(int pn)
|
int |
getTurnIndex()
Returns the current turn index |
java.util.Enumeration<GameTurn> |
getTurns()
Returns an Enumeration of the current turn list |
java.util.Vector<GameTurn> |
getTurnVector()
Returns the current turn vector |
java.util.Vector<Entity> |
getUndeployedEntities()
Returns a vector of entities that have not yet deployed |
java.util.Vector<Entity> |
getValidTargets(Entity entity)
Get a vector of entity objects that are "acceptable" to attack with this entity |
int |
getVehiclesLeft(int playerId)
Returns the number of Vehicles that playerId
has not moved yet this turn. |
java.util.Vector<Minefield> |
getVibrabombs()
|
Victory |
getVictory()
|
java.util.HashMap<java.lang.String,java.lang.Object> |
getVictoryContext()
|
int |
getVictoryPlayerId()
Getter for property victoryPlayerId. |
int |
getVictoryTeam()
Getter for property victoryTeam. |
java.util.Enumeration<Entity> |
getWreckedEntities()
Returns an enumeration of wrecked entities. |
boolean |
hasEntity(int entityId)
Returns true if an entity with the specified id number exists in this game. |
boolean |
hasMoreTurns()
Returns true if there is a turn after the current one |
boolean |
hasTacticalGenius(Player player)
Returns true if the player has a valid unit with the Tactical Genius pilot special ability. |
void |
incrementRoundCount()
Increments the round counter |
void |
insertNextTurn(GameTurn turn)
Inserts a turn that will come directly after the current one |
boolean |
isDeploymentComplete()
|
boolean |
isEntityStranded(Entity entity)
Determines if the indicated entity is stranded on a transport that can't move. |
boolean |
isForceVictory()
Getter for property forceVictory. |
boolean |
isOutOfGame(Entity entity)
See if the Entity is out of the game. |
boolean |
isOutOfGame(int id)
See if the Entity with the given ID is out of the game. |
boolean |
isPhaseSimultaneous()
|
boolean |
isPlayerVictor(int playerId)
Shortcut to isPlayerVictor(Player player) |
boolean |
isPlayerVictor(Player player)
Returns true if the specified player is either the victor, or is on the winning team. |
boolean |
isPositionIlluminated(Coords c)
returns true if the hex is illuminated by a flare |
void |
moveToGraveyard(int id)
Moves an entity into the graveyard so it stops getting sent out every phase. |
boolean |
phaseHasTurns(IGame.Phase thisPhase)
Returns true if this phase has turns. |
void |
processGameEvent(GameEvent event)
Processes game events occurring on this connection by dispatching them to any registered GameListener objects. |
void |
purgeGameListeners()
purges all Game Listener objects. |
void |
removeAction(java.lang.Object o)
Remove a specified action |
void |
removeActionsFor(int entityId)
Removes all actions by the specified entity |
void |
removeAttack(AttackHandler ah)
remove an AttackHandler from the attacks list |
void |
removeEntity(int id,
int condition)
Remove an entity from the master list. |
GameTurn |
removeFirstTurnFor(Entity entity)
Removes the first turn found that the specified entity can move in. |
void |
removeGameListener(GameListener listener)
Removes the specified game listener. |
void |
removeMinefield(Minefield mf)
Removes the specified minefield |
void |
removeMinefieldHelper(Minefield mf)
|
void |
removePlayer(int id)
|
void |
removeTurnFor(Entity entity)
Removes the last, next turn found that the specified entity can move in. |
void |
removeVibrabomb(Minefield mf)
Removes the specified Vibrabomb |
void |
reset()
Resets this game. |
void |
resetActions()
Resets the actions list. |
void |
resetArtilleryAttacks()
|
void |
resetAttacks()
reset the attacks vector |
void |
resetCharges()
Resets the pending charges list. |
void |
resetControlRolls()
Resets the PSR list. |
void |
resetControlRolls(Entity entity)
Resets the Control Roll list for a given entity. |
void |
resetExtremeGravityPSRs()
Resets the extreme Gravity PSR list. |
void |
resetExtremeGravityPSRs(Entity entity)
Resets the extreme Gravity PSR list for a given entity. |
void |
resetMinefieldDensity(java.util.Vector<Minefield> newMinefields)
Resets the minefield density for a given Vector of minefields |
void |
resetPSRs()
Resets the PSR list. |
void |
resetPSRs(Entity entity)
Resets the PSR list for a given entity. |
void |
resetRams()
Resets the pending rams list. |
void |
resetTagInfo()
Reset tag information |
void |
resetTeleMissileAttacks()
Resets the pending rams list. |
void |
resetTurnIndex()
Resets the turn index to -1 (awaiting first turn) |
void |
rollInitAndResolveTies()
|
void |
setAllReports(java.util.Vector<java.util.Vector<Report>> v)
Used to populate previous game reports, e.g. after a client connects to an existing game. |
void |
setArtilleryVector(java.util.Vector<ArtilleryAttackAction> v)
|
void |
setAttacksVector(java.util.Vector<AttackHandler> v)
set the attacks vector |
void |
setBoard(IBoard board)
Sets the new game board |
void |
setDeploymentComplete(boolean deploymentComplete)
|
void |
setEntitiesVector(java.util.Vector<Entity> entities)
|
void |
setEntity(int id,
Entity entity)
|
void |
setEntity(int id,
Entity entity,
java.util.Vector<UnitLocation> movePath)
|
void |
setExternalGameId(int value)
|
void |
setFlares(java.util.Vector<Flare> flares)
Set the list of flares |
void |
setForceVictory(boolean forceVictory)
Setter for property forceVictory. |
void |
setLastPhase(IGame.Phase lastPhase)
|
void |
setMinefields(java.util.Vector<Minefield> minefields)
Sets the minefields to the given Vector of the minefields |
void |
setOptions(GameOptions options)
sets the game options |
void |
setOutOfGameEntitiesVector(java.util.Vector<Entity> vOutOfGame)
Swap out the current list of dead (or fled) units for a new one. |
void |
setPhase(IGame.Phase phase)
|
void |
setPlanetaryConditions(PlanetaryConditions conditions)
|
void |
setPlayer(int id,
Player player)
|
void |
setRoundCount(int roundCount)
|
void |
setTurnIndex(int turnIndex)
Sets the current turn index |
void |
setTurnVector(java.util.Vector<GameTurn> turnVector)
Sets the current turn vector |
void |
setupRoundDeployment()
Sets up up the hashtable of who deploys when |
void |
setupTeams()
Set up the teams vector. |
void |
setVictoryContext(java.util.HashMap<java.lang.String,java.lang.Object> ctx)
set the game victory state. |
void |
setVictoryPlayerId(int victoryPlayerId)
Setter for property victoryPlayerId. |
void |
setVictoryTeam(int victoryTeam)
Setter for property victoryTeam. |
boolean |
shouldDeployForRound(int round)
|
boolean |
shouldDeployThisRound()
Check to see if we should deploy this round |
protected void |
updatePlayer(Player player)
|
boolean |
useVectorMove()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public IBoard board
java.util.Vector<Entity> vOutOfGame
| Constructor Detail |
|---|
public Game()
| Method Detail |
|---|
public int getExternalGameId()
getExternalGameId in interface IGamepublic void setExternalGameId(int value)
setExternalGameId in interface IGamepublic IBoard getBoard()
getBoard in interface IGamepublic void setBoard(IBoard board)
IGame
setBoard in interface IGamepublic boolean containsMinefield(Coords coords)
IGame
containsMinefield in interface IGamecoords - coords to check
true if there is a minefield at given coords or
false otherwisepublic java.util.Vector<Minefield> getMinefields(Coords coords)
IGame
getMinefields in interface IGameVector of minefields at specified coordpublic int getNbrMinefields(Coords coords)
IGame
getNbrMinefields in interface IGamepublic java.util.Enumeration<Coords> getMinedCoords()
getMinedCoords in interface IGameEnumeration of the Coords
containing minefields. This will not be null.public void addMinefield(Minefield mf)
IGame
addMinefield in interface IGamemf - minefield to addpublic void addMinefields(java.util.Vector<Minefield> mines)
IGame
addMinefields in interface IGamemines - the Vector of the minefields to addpublic void setMinefields(java.util.Vector<Minefield> minefields)
IGameVector of the minefields
setMinefields in interface IGamepublic void resetMinefieldDensity(java.util.Vector<Minefield> newMinefields)
IGameVector of minefields
resetMinefieldDensity in interface IGameprotected void addMinefieldHelper(Minefield mf)
public void removeMinefield(Minefield mf)
IGame
removeMinefield in interface IGamemf - minefield to removepublic void removeMinefieldHelper(Minefield mf)
public void clearMinefields()
IGame
clearMinefields in interface IGameprotected void clearMinefieldsHelper()
public java.util.Vector<Minefield> getVibrabombs()
getVibrabombs in interface IGameVector of the vibrabombspublic void addVibrabomb(Minefield mf)
IGame
addVibrabomb in interface IGamemf - Vibrabomb to addpublic void removeVibrabomb(Minefield mf)
IGame
removeVibrabomb in interface IGamemf - Vibrabomb to removepublic boolean containsVibrabomb(Minefield mf)
IGame
containsVibrabomb in interface IGamemf - the Vibrabomb to ceck
public GameOptions getOptions()
getOptions in interface IGamepublic void setOptions(GameOptions options)
IGame
setOptions in interface IGamepublic java.util.Enumeration<Team> getTeams()
getTeams in interface IGamepublic int getNoOfTeams()
getNoOfTeams in interface IGamepublic java.util.Vector<Team> getTeamsVector()
getTeamsVector in interface IGamepublic Team getTeamForPlayer(Player p)
getTeamForPlayer in interface IGamepublic void setupTeams()
setupTeams in interface IGamepublic java.util.Enumeration<Player> getPlayers()
getPlayers in interface IGamepublic java.util.Vector<Player> getPlayersVector()
getPlayersVector in interface IGamepublic int getNoOfPlayers()
getNoOfPlayers in interface IGamepublic Player getPlayer(int id)
getPlayer in interface IGame
public void addPlayer(int id,
Player player)
addPlayer in interface IGame
public void setPlayer(int id,
Player player)
setPlayer in interface IGameprotected void updatePlayer(Player player)
public void removePlayer(int id)
removePlayer in interface IGamepublic int getEntitiesOwnedBy(Player player)
getEntitiesOwnedBy in interface IGamepublic int getAllEntitiesOwnedBy(Player player)
getAllEntitiesOwnedBy in interface IGamepublic int getLiveEntitiesOwnedBy(Player player)
getLiveEntitiesOwnedBy in interface IGamepublic int getLiveDeployedEntitiesOwnedBy(Player player)
getLiveDeployedEntitiesOwnedBy in interface IGamepublic int getLiveCommandersOwnedBy(Player player)
getLiveCommandersOwnedBy in interface IGamepublic boolean hasTacticalGenius(Player player)
hasTacticalGenius in interface IGamepublic java.util.Vector<Entity> getValidTargets(Entity entity)
getValidTargets in interface IGamepublic boolean phaseHasTurns(IGame.Phase thisPhase)
phaseHasTurns in interface IGamepublic boolean isPhaseSimultaneous()
isPhaseSimultaneous in interface IGamepublic GameTurn getTurn()
getTurn in interface IGamepublic GameTurn getTurnForPlayer(int pn)
getTurnForPlayer in interface IGamepublic GameTurn changeToNextTurn()
changeToNextTurn in interface IGamepublic void resetTurnIndex()
resetTurnIndex in interface IGamepublic boolean hasMoreTurns()
hasMoreTurns in interface IGamepublic void insertNextTurn(GameTurn turn)
insertNextTurn in interface IGamepublic java.util.Enumeration<GameTurn> getTurns()
getTurns in interface IGamepublic int getTurnIndex()
getTurnIndex in interface IGamepublic void setTurnIndex(int turnIndex)
setTurnIndex in interface IGamepublic java.util.Vector<GameTurn> getTurnVector()
getTurnVector in interface IGamepublic void setTurnVector(java.util.Vector<GameTurn> turnVector)
setTurnVector in interface IGamepublic IGame.Phase getPhase()
getPhase in interface IGamepublic void setPhase(IGame.Phase phase)
setPhase in interface IGamepublic IGame.Phase getLastPhase()
getLastPhase in interface IGamepublic void setLastPhase(IGame.Phase lastPhase)
setLastPhase in interface IGamepublic void setDeploymentComplete(boolean deploymentComplete)
setDeploymentComplete in interface IGamepublic boolean isDeploymentComplete()
isDeploymentComplete in interface IGamepublic void setupRoundDeployment()
setupRoundDeployment in interface IGamepublic void checkForCompleteDeployment()
checkForCompleteDeployment in interface IGamepublic boolean shouldDeployThisRound()
shouldDeployThisRound in interface IGamepublic boolean shouldDeployForRound(int round)
shouldDeployForRound in interface IGamepublic void clearDeploymentThisRound()
clearDeploymentThisRound in interface IGamepublic java.util.Vector<Entity> getUndeployedEntities()
getUndeployedEntities in interface IGamepublic java.util.Enumeration<Entity> getEntities()
getEntities in interface IGamepublic Entity getPreviousEntityFromList(Entity current)
IGame
getPreviousEntityFromList in interface IGamecurrent - The Entity whose list position you wish to
start from.
Entity in the list.public Entity getNextEntityFromList(Entity current)
IGame
getNextEntityFromList in interface IGamecurrent - The Entity whose list position you wish to
start from.
Entity in the list.public java.util.Vector<Entity> getEntitiesVector()
getEntitiesVector in interface IGamepublic void setEntitiesVector(java.util.Vector<Entity> entities)
setEntitiesVector in interface IGamepublic java.util.Vector<Entity> getOutOfGameEntitiesVector()
getOutOfGameEntitiesVector in interface IGamepublic void setOutOfGameEntitiesVector(java.util.Vector<Entity> vOutOfGame)
setOutOfGameEntitiesVector in interface IGamevOutOfGame - - the new Vector of dead or fled units.
This value should not be null.
java.lang.IllegalArgumentException - if the new list is null.public Entity getOutOfGameEntity(int id)
getOutOfGameEntity in interface IGameid - the int ID of the out-of-game entity.
Entity with that ID. If no
out-of-game entity has that ID, returns a null.public java.util.Vector<Entity> getC3NetworkMembers(Entity entity)
Vector containing the Entitys
that are in the same C3 network as the passed-in unit. The output will
contain the passed-in unit, if the unit has a C3 computer. If the unit
has no C3 computer, the output will be empty (but it will never be
null).
getC3NetworkMembers in interface IGameentity - - the Entity whose C3 network co- members is
required. This value may be null.
Vector that will contain all other
Entitys that are in the same C3 network as the
passed-in unit. This Vector may be empty, but it
will not be null.getC3SubNetworkMembers( Entity )public java.util.Vector<Entity> getC3SubNetworkMembers(Entity entity)
Vector containing the Entitys
that are in the C3 sub-network under the passed-in unit. The output will
contain the passed-in unit, if the unit has a C3 computer. If the unit
has no C3 computer, the output will be empty (but it will never be
null). If the passed-in unit is a company commander or a
member of a C3i network, this call is the same as
getC3NetworkMembers.
getC3SubNetworkMembers in interface IGameentity - - the Entity whose C3 network sub- members
is required. This value may be null.
Vector that will contain all other
Entitys that are in the same C3 network under the
passed-in unit. This Vector may be empty, but it
will not be null.getC3NetworkMembers( Entity )public java.util.Hashtable<Coords,java.util.Vector<Entity>> getPositionMap()
Hashtable that maps the Coords of
each unit in this Game to a Vector of
Entitys at that positions. Units that have no position
(e.g. loaded units) will not be in the map.
getPositionMap in interface IGameHashtable that maps the Coords
positions or each unit in the game to a Vector of
Entitys at that position.public java.util.Enumeration<Entity> getGraveyardEntities()
getGraveyardEntities in interface IGamepublic java.util.Enumeration<Entity> getWreckedEntities()
getWreckedEntities in interface IGamepublic java.util.Enumeration<Entity> getRetreatedEntities()
getRetreatedEntities in interface IGamepublic java.util.Enumeration<Entity> getDevastatedEntities()
getDevastatedEntities in interface IGamepublic int getNoOfEntities()
getNoOfEntities in interface IGame
public Targetable getTarget(int nType,
int nID)
getTarget in interface IGamepublic Entity getEntity(int id)
getEntity in interface IGame
public void addEntity(int id,
Entity entity)
addEntity in interface IGame
public void setEntity(int id,
Entity entity)
setEntity in interface IGame
public void setEntity(int id,
Entity entity,
java.util.Vector<UnitLocation> movePath)
setEntity in interface IGamepublic int getNextEntityId()
getNextEntityId in interface IGamepublic boolean hasEntity(int entityId)
hasEntity in interface IGametrue if an entity with the specified id number
exists in this game.
public void removeEntity(int id,
int condition)
removeEntity in interface IGamepublic void reset()
reset in interface IGamepublic Entity getFirstEntity(Coords c)
getFirstEntity in interface IGamec - the coordinates to search at
public Entity getFirstEnemyEntity(Coords c,
Entity currentEntity)
getFirstEnemyEntity in interface IGamec - the coordinates to search atcurrentEntity - the entity that is firingpublic java.util.Enumeration<Entity> getEntities(Coords c)
getEntities in interface IGamepublic java.util.Vector<Entity> getEntitiesVector(Coords c)
c
getEntitiesVector in interface IGamec -
Vectorpublic java.util.Vector<GunEmplacement> getGunEmplacements(Coords c)
c
getGunEmplacements in interface IGamec -
Vector
public Entity getAffaTarget(Coords c,
Entity ignore)
getAffaTarget in interface IGamec - The Coords of the hex in which the accidental
fall from above happensignore - The entity who is falling
Entity that should be an AFFA target.
public java.util.Enumeration<Entity> getEnemyEntities(Coords c,
Entity currentEntity)
Enumeration of the enemy's active entities at
the given coordinates.
getEnemyEntities in interface IGamec - the Coords of the hex being examined.currentEntity - the Entity whose enemies are needed.
Enumeration of Entitys at the
given coordinates who are enemies of the given unit.
public java.util.Enumeration<Entity> getFriendlyEntities(Coords c,
Entity currentEntity)
Enumeration of friendly active entities at the
given coordinates.
getFriendlyEntities in interface IGamec - the Coords of the hex being examined.currentEntity - the Entity whose friends are needed.
Enumeration of Entitys at the
given coordinates who are friends of the given unit.public void moveToGraveyard(int id)
moveToGraveyard in interface IGamepublic boolean isOutOfGame(int id)
Entity with the given ID is out of the game.
isOutOfGame in interface IGameid - - the ID of the Entity to be checked.
true if the Entity is in the
graveyard, false otherwise.public boolean isOutOfGame(Entity entity)
Entity is out of the game.
isOutOfGame in interface IGameentity - - the Entity to be checked.
true if the Entity is in the
graveyard, false otherwise.public Entity getFirstEntity()
getFirstEntity in interface IGamepublic Entity getFirstEntity(GameTurn turn)
getFirstEntity in interface IGamepublic int getFirstEntityNum()
getFirstEntityNum in interface IGamepublic int getFirstEntityNum(GameTurn turn)
getFirstEntityNum in interface IGamepublic Entity getNextEntity(int start)
getNextEntity in interface IGamestart - the index number to start atpublic int getNextEntityNum(int start)
IGame
getNextEntityNum in interface IGamestart - the index number to start at
public int getNextEntityNum(GameTurn turn,
int start)
getNextEntityNum in interface IGameturn - the turn to usestart - the entity id to start atpublic int getFirstDeployableEntityNum()
getFirstDeployableEntityNum in interface IGamepublic int getFirstDeployableEntityNum(GameTurn turn)
getFirstDeployableEntityNum in interface IGamepublic int getNextDeployableEntityNum(int entityId)
getNextDeployableEntityNum in interface IGame
public int getNextDeployableEntityNum(GameTurn turn,
int start)
getNextDeployableEntityNum in interface IGame
public java.util.ArrayList<Entity> getPlayerEntities(Player player,
boolean hide)
getPlayerEntities in interface IGameplayer - - the Player whose entities are required.hide - - should fighters loaded into squadrons be excluded?
Vector of Entitys.public boolean isEntityStranded(Entity entity)
isEntityStranded in interface IGameentity - the Entity that may be stranded
true if the entity is stranded false
otherwise.public int getInfantryLeft(int playerId)
getInfantryLeft in interface IGamepublic int getProtomechsLeft(int playerId)
getProtomechsLeft in interface IGamepublic int getVehiclesLeft(int playerId)
playerId
has not moved yet this turn.
getVehiclesLeft in interface IGameplayerId -
playerId has not moved yet this turnpublic GameTurn removeFirstTurnFor(Entity entity)
removeFirstTurnFor in interface IGamepublic void removeTurnFor(Entity entity)
removeTurnFor in interface IGamepublic boolean checkForMagneticClamp()
checkForMagneticClamp in interface IGametrue if a unit was updated, false
if no player has a Battle Armor squad equipped with a Magnetic
Clamp.public void addAction(EntityAction ea)
addAction in interface IGamepublic void setArtilleryVector(java.util.Vector<ArtilleryAttackAction> v)
setArtilleryVector in interface IGamepublic void resetArtilleryAttacks()
public java.util.Enumeration<ArtilleryAttackAction> getArtilleryAttacks()
getArtilleryAttacks in interface IGamepublic int getArtillerySize()
getArtillerySize in interface IGamepublic java.util.Enumeration<EntityAction> getActions()
getActions in interface IGamepublic void resetActions()
resetActions in interface IGamepublic void removeActionsFor(int entityId)
removeActionsFor in interface IGamepublic void removeAction(java.lang.Object o)
removeAction in interface IGameo - The action to remove.public int actionsSize()
actionsSize in interface IGamepublic java.util.Vector<EntityAction> getActionsVector()
getActionsVector in interface IGamepublic void addInitiativeRerollRequest(Team t)
addInitiativeRerollRequest in interface IGamepublic void rollInitAndResolveTies()
rollInitAndResolveTies in interface IGamepublic int getNoOfInitiativeRerollRequests()
getNoOfInitiativeRerollRequests in interface IGamepublic void addCharge(AttackAction ea)
addCharge in interface IGamepublic java.util.Enumeration<AttackAction> getCharges()
getCharges in interface IGamepublic void resetCharges()
resetCharges in interface IGamepublic java.util.Vector<AttackAction> getChargesVector()
getChargesVector in interface IGamepublic void addRam(AttackAction ea)
addRam in interface IGamepublic java.util.Enumeration<AttackAction> getRams()
getRams in interface IGamepublic void resetRams()
resetRams in interface IGamepublic java.util.Vector<AttackAction> getRamsVector()
getRamsVector in interface IGamepublic void addTeleMissileAttack(AttackAction ea)
addTeleMissileAttack in interface IGamepublic java.util.Enumeration<AttackAction> getTeleMissileAttacks()
getTeleMissileAttacks in interface IGamepublic void resetTeleMissileAttacks()
resetTeleMissileAttacks in interface IGamepublic java.util.Vector<AttackAction> getTeleMissileAttacksVector()
getTeleMissileAttacksVector in interface IGamepublic void addPSR(PilotingRollData psr)
addPSR in interface IGamepublic java.util.Enumeration<PilotingRollData> getPSRs()
getPSRs in interface IGamepublic void addExtremeGravityPSR(PilotingRollData psr)
addExtremeGravityPSR in interface IGamepublic java.util.Enumeration<PilotingRollData> getExtremeGravityPSRs()
getExtremeGravityPSRs in interface IGamepublic void resetPSRs(Entity entity)
resetPSRs in interface IGamepublic void resetExtremeGravityPSRs()
resetExtremeGravityPSRs in interface IGamepublic void resetExtremeGravityPSRs(Entity entity)
resetExtremeGravityPSRs in interface IGamepublic void resetPSRs()
resetPSRs in interface IGamepublic void addAttack(AttackHandler ah)
addAttack in interface IGameah - - The AttackHandler to addpublic void removeAttack(AttackHandler ah)
removeAttack in interface IGameah - - The AttackHandler to removepublic java.util.Enumeration<AttackHandler> getAttacks()
getAttacks in interface IGameEnumeration of all AttackHandlerspublic java.util.Vector<AttackHandler> getAttacksVector()
getAttacksVector in interface IGameVector containing the attackspublic void resetAttacks()
resetAttacks in interface IGamepublic void setAttacksVector(java.util.Vector<AttackHandler> v)
setAttacksVector in interface IGamev - - the Vector that should be the new attacks
vectorpublic int getRoundCount()
getRoundCount in interface IGamepublic void setRoundCount(int roundCount)
setRoundCount in interface IGamepublic void incrementRoundCount()
incrementRoundCount in interface IGamepublic boolean isForceVictory()
isForceVictory in interface IGamepublic void setForceVictory(boolean forceVictory)
setForceVictory in interface IGameforceVictory - New value of property forceVictory.public void addReports(java.util.Vector<Report> v)
IGame
addReports in interface IGamev - Vector of reportspublic java.util.Vector<Report> getReports(int r)
IGame
getReports in interface IGamer - Round numberpublic java.util.Vector<java.util.Vector<Report>> getAllReports()
IGame
getAllReports in interface IGamepublic void setAllReports(java.util.Vector<java.util.Vector<Report>> v)
IGame
setAllReports in interface IGamepublic void clearAllReports()
IGame
clearAllReports in interface IGame
public void end(int winner,
int winnerTeam)
end in interface IGamepublic int getVictoryPlayerId()
getVictoryPlayerId in interface IGamepublic void setVictoryPlayerId(int victoryPlayerId)
setVictoryPlayerId in interface IGamevictoryPlayerId - New value of property victoryPlayerId.public int getVictoryTeam()
getVictoryTeam in interface IGamepublic void setVictoryTeam(int victoryTeam)
setVictoryTeam in interface IGamevictoryTeam - New value of property victoryTeam.public boolean isPlayerVictor(Player player)
isPlayerVictor in interface IGamepublic java.util.HashMap<java.lang.String,java.lang.Object> getVictoryContext()
getVictoryContext in interface IGamepublic void setVictoryContext(java.util.HashMap<java.lang.String,java.lang.Object> ctx)
IGame
setVictoryContext in interface IGamepublic boolean isPlayerVictor(int playerId)
isPlayerVictor in interface IGamepublic java.util.Enumeration<Entity> getSelectedEntities(EntitySelector selector)
Entitys that pass the given selection criteria.
getSelectedEntities in interface IGameselector - the EntitySelector that implements test
that an entity must pass to be included. This value may be
null (in which case all entities in the game
will be returned).
Enumeration of all entities that the selector
accepts. This value will not be null but it may be
empty.public int getSelectedEntityCount(EntitySelector selector)
Entitys that pass the given selection criteria.
getSelectedEntityCount in interface IGameselector - the EntitySelector that implements test
that an entity must pass to be included. This value may be
null (in which case the count of all entities
in the game will be returned).
int count of all entities that the selector
accepts. This value will not be null but it may be
empty.public java.util.Enumeration<Entity> getSelectedOutOfGameEntities(EntitySelector selector)
Entitys that pass the given selection
criteria.
getSelectedOutOfGameEntities in interface IGameselector - the EntitySelector that implements test
that an entity must pass to be included. This value may be
null (in which case all entities in the game
will be returned).
Enumeration of all entities that the selector
accepts. This value will not be null but it may be
empty.public int getSelectedOutOfGameEntityCount(EntitySelector selector)
Entitys that pass the given
selection criteria.
getSelectedOutOfGameEntityCount in interface IGameselector - the EntitySelector that implements test
that an entity must pass to be included. This value may be
null (in which case the count of all
out-of-game entities will be returned).
int count of all entities that the selector
accepts. This value will not be null but it may be
empty.public boolean checkForValidNonInfantryAndOrProtomechs(int playerId)
checkForValidNonInfantryAndOrProtomechs in interface IGame
public java.util.Enumeration<Entity> getNemesisTargets(Entity attacker,
Coords target)
getNemesisTargets in interface IGameattacker - The attacking Entity.target - The Coords of the original target.
Enumeration of entities that have nemesis pods
attached and are located between attacker and target and are
friendly with the attacker.public void addGameListener(GameListener listener)
addGameListener in interface IGamelistener - the game listener.public void removeGameListener(GameListener listener)
removeGameListener in interface IGamelistener - the game listener.public java.util.Vector<GameListener> getGameListeners()
getGameListeners in interface IGamepublic void purgeGameListeners()
purgeGameListeners in interface IGamepublic void processGameEvent(GameEvent event)
processGameEvent in interface IGameevent - the game event.public java.util.Vector<TagInfo> getTagInfo()
getTagInfo in interface IGamepublic void addTagInfo(TagInfo info)
IGame
addTagInfo in interface IGamepublic void resetTagInfo()
IGame
resetTagInfo in interface IGame
public void clearTagInfoShots(Entity ae,
Coords tc)
IGame
clearTagInfoShots in interface IGamepublic java.util.Vector<Flare> getFlares()
getFlares in interface IGamepublic void setFlares(java.util.Vector<Flare> flares)
setFlares in interface IGamepublic void addFlare(Flare flare)
addFlare in interface IGamepublic boolean isPositionIlluminated(Coords c)
isPositionIlluminated in interface IGamepublic java.util.Vector<Report> ageFlares()
ageFlares in interface IGamepublic boolean gameTimerIsExpired()
gameTimerIsExpired in interface IGamepublic void createVictoryConditions()
createVictoryConditions in interface IGamepublic Victory getVictory()
getVictory in interface IGamepublic boolean useVectorMove()
useVectorMove in interface IGamepublic void addControlRoll(PilotingRollData control)
addControlRoll in interface IGamepublic java.util.Enumeration<PilotingRollData> getControlRolls()
getControlRolls in interface IGamepublic void resetControlRolls(Entity entity)
resetControlRolls in interface IGamepublic void resetControlRolls()
resetControlRolls in interface IGamepublic boolean checkForValidSpaceStations(int playerId)
checkForValidSpaceStations in interface IGamepublic boolean checkForValidJumpships(int playerId)
checkForValidJumpships in interface IGamepublic boolean checkForValidWarships(int playerId)
checkForValidWarships in interface IGamepublic boolean checkForValidDropships(int playerId)
checkForValidDropships in interface IGamepublic boolean checkForValidSmallCraft(int playerId)
checkForValidSmallCraft in interface IGamepublic PlanetaryConditions getPlanetaryConditions()
getPlanetaryConditions in interface IGamepublic void setPlanetaryConditions(PlanetaryConditions conditions)
setPlanetaryConditions in interface IGamepublic void addSmokeCloud(SmokeCloud cloud)
IGame
addSmokeCloud in interface IGamepublic java.util.List<SmokeCloud> getSmokeCloudList()
IGame
getSmokeCloudList in interface IGame
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||