Package megamek.common.alphaStrike
Class ASGame
java.lang.Object
megamek.common.game.AbstractGame
megamek.common.alphaStrike.ASGame
- All Implemented Interfaces:
IGame
This is an Alpha Strike game object that holds all game information. This is intentionally a stub and currently only
intended to see how to work with MM's interfaces. In the future, it could be completed to support AS games.
-
Field Summary
Fields inherited from class megamek.common.game.AbstractGame
currentRound, forces, gameListeners, groundObjects, inGameObjects, pendingActions, players, scriptedEvents, teams, turnIndexFields inherited from interface megamek.common.game.IGame
DEFAULT_BOARD_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the given Player to the game with the given game-unique id.getBoard()Returns the game's board.getNewReport(int messageId) Returns a new ReportEntry with the given report message ID.getPhase()getTurn()booleanReturns true when the current game phase should be played, meaning it is played in the current type of game and there are possible actions in it in the present game state.booleanvoidremovePlayer(int id) Removes the player with the id from the game.voidreplaceUnits(List<InGameObject> units) This is a Client-side method to replace or add units that are sent from the server.voidvoidsetLastPhase(GamePhase lastPhase) Sets the previous game phase to the given phase.voidsetOptions(GameOptions options) voidSets the current game phase to the given phase.voidSets the given Player to the given game-unique id.voidMethods inherited from class megamek.common.game.AbstractGame
addAction, addGameListener, addScriptedEvent, canFleeFrom, clearActions, clearDeploymentThisRound, clearScriptedEvents, deployableInGameObjects, fireGameEvent, getActionsVector, getBoard, getBoardIds, getBoards, getCurrentRound, getFleeZone, getForces, getGameListeners, getGroundObjects, getGroundObjects, getInGameObjects, getNextEntityId, getNoOfPlayers, getNoOfTeams, getPlayer, getPlayersList, getTeams, getTurnIndex, incrementCurrentRound, isDeploymentComplete, lastDeploymentRound, placeGroundObject, receiveBoard, receiveBoards, removeAction, removeActionsFor, removeGameListener, removeGroundObject, reset, resetTurnIndex, scriptedEvents, setBoard, setCurrentRound, setForces, setGroundObjects, setTurnIndex, setupDeployment, shouldDeployForRound, shouldDeployThisRoundMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface megamek.common.game.IGame
areConnectedBoards, boardExists, commonEnclosingBoard, connectBoards, getAllEnclosingBoards, getBoard, getBoard, getEnclosingBoard, getEnclosingBoard, getEntitiesOwnedBy, getEntityFromAllSources, getHex, getHex, getHexOf, getInGameObject, getInGameObjects, getOutOfGameUnit, getTeamByPlayer, getTeamForPlayer, hasBoard, hasBoard, hasBoardLocation, hasBoardLocation, hasBoardLocationOf, hasConnectedBoard, hasEnclosingBoard, hasGroundBoard, hasMoreTurns, hasNonSpaceBoard, hasPlayer, hasSpaceAndAtmosphericBoards, hasSpaceBoard, isOnAtmosphericMap, isOnAtmosphericMap, isOnGroundMap, isOnGroundMap, isOnSpaceMap, isOnSpaceMap, onConnectedBoards, onDirectlyConnectedBoards, onTheSameBoard, receivePhase, shouldSkipCurrentPhase
-
Constructor Details
-
ASGame
public ASGame()
-
-
Method Details
-
getTurn
-
getTurnsList
- Returns:
- the current list of turns. If you're not the GameManager, don't even think about changing any of the turns.
-
getOptions
-
getPhase
- Returns:
- The current phase of this game.
-
setPhase
Description copied from interface:IGameSets the current game phase to the given phase. May perform phase-dependent cleanup. This method is intended for the GameManager.- Parameters:
phase- The new phase
-
setLastPhase
Description copied from interface:IGameSets the previous game phase to the given phase. This method is intended for the GameManager.- Parameters:
lastPhase- The phase to be remembered as the previous phase.
-
isForceVictory
public boolean isForceVictory()- Returns:
- Whether there is an active claim for victory.
-
addPlayer
Description copied from interface:IGameAdds the given Player to the game with the given game-unique id. // TODO : Can this be made a default method?- Specified by:
addPlayerin interfaceIGame- Overrides:
addPlayerin classAbstractGame- Parameters:
id- The game-unique id of this playerplayer- The Player object
-
isCurrentPhasePlayable
public boolean isCurrentPhasePlayable()Description copied from interface:IGameReturns true when the current game phase should be played, meaning it is played in the current type of game and there are possible actions in it in the present game state. The result may be different in other rounds.- Returns:
- True when the current phase should be skipped entirely in this round
- See Also:
-
setPlayer
Description copied from interface:IGameSets the given Player to the given game-unique id. // TODO : Is this method useful? Why not use addPlayer that also sets single-blind info?- Parameters:
id- The game-unique id of this playerplayer- The Player object
-
removePlayer
public void removePlayer(int id) Description copied from interface:IGameRemoves the player with the id from the game.- Parameters:
id- The player id
-
setupTeams
public void setupTeams() -
replaceUnits
Description copied from interface:IGameThis is a Client-side method to replace or add units that are sent from the server. Adds the given units to the list of units or objects in the current game. When a unit's ID is already present the currently assigned unit will be replaced with the given new one.- Parameters:
units- The units to add or use as a replacement for current units.
-
getGraveyard
- Returns:
- a list of units that are destroyed or otherwise no longer part of the game. These should have a reason for their removal set.
-
getNewReport
Description copied from interface:IGameReturns a new ReportEntry with the given report message ID. The ReportEntry subclass returned depends on the implementation in the IGame subclass.- Parameters:
messageId- The message ID from report-messages.properties- Returns:
- A new report of an appropriate type and message
-
setOptions
-
getBoard
Description copied from interface:IGameReturns the game's board. This method internally uses the boardId 0 for every call, seeIGame.getBoard(int). It can eventually be replaced to allow multiple maps for any type of game.- Returns:
- The game's board (using ID = 0)
-
setBoard
-