Class ASGame

java.lang.Object
megamek.common.AbstractGame
megamek.common.alphaStrike.ASGame
All Implemented Interfaces:
IGame

public class ASGame extends AbstractGame
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.
  • Constructor Details

    • ASGame

      public ASGame()
  • Method Details

    • getTurn

      public GameTurn getTurn()
    • getTurnsList

      public List<GameTurn> getTurnsList()
      Returns:
      the current list of turns. If you're not the GameManager, don't even think about changing any of the turns.
    • getOptions

      public IGameOptions getOptions()
    • getPhase

      public GamePhase getPhase()
      Returns:
      The current phase of this game.
    • setPhase

      public void setPhase(GamePhase phase)
      Description copied from interface: IGame
      Sets 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

      public void setLastPhase(GamePhase lastPhase)
      Description copied from interface: IGame
      Sets 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

      public void addPlayer(int id, Player player)
      Description copied from interface: IGame
      Adds the given Player to the game with the given game-unique id. // TODO : Can this be made a default method?
      Specified by:
      addPlayer in interface IGame
      Overrides:
      addPlayer in class AbstractGame
      Parameters:
      id - The game-unique id of this player
      player - The Player object
    • isCurrentPhasePlayable

      public boolean isCurrentPhasePlayable()
      Description copied from interface: IGame
      Returns 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

      public void setPlayer(int id, Player player)
      Description copied from interface: IGame
      Sets 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 player
      player - The Player object
    • removePlayer

      public void removePlayer(int id)
      Description copied from interface: IGame
      Removes the player with the id from the game.
      Parameters:
      id - The player id
    • setupTeams

      public void setupTeams()
    • replaceUnits

      public void replaceUnits(List<InGameObject> units)
      Description copied from interface: IGame
      This 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

      public List<InGameObject> 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

      public ReportEntry getNewReport(int messageId)
      Description copied from interface: IGame
      Returns 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