Class NewGameIndicator

java.lang.Object
VASSAL.build.module.NewGameIndicator
All Implemented Interfaces:
GameComponent, CommandEncoder

public class NewGameIndicator extends Object implements GameComponent, CommandEncoder
Provides information about whether a game was started from File->New Game or loaded from a saved game
  • Constructor Details

    • NewGameIndicator

      public NewGameIndicator(String command)
  • Method Details

    • getRestoreCommand

      public Command getRestoreCommand()
      Description copied from interface: GameComponent
      When saving a game, each GameComponent should return a Command that, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return null
      Specified by:
      getRestoreCommand in interface GameComponent
    • isNewGame

      public boolean isNewGame()
      Returns:
      true if the current game was started from the menu, false if it was loaded from a saved game or logfile.
    • setup

      public void setup(boolean gameStarting)
      Description copied from interface: GameComponent
      Notify the GameComponent that a game has started/ended
      Specified by:
      setup in interface GameComponent
      Parameters:
      gameStarting - if true, a game is starting. If false, then a game is ending
    • decode

      public Command decode(String command)
      Description copied from interface: CommandEncoder
      Translate a String into a Command
      Specified by:
      decode in interface CommandEncoder
    • encode

      public String encode(Command c)
      Description copied from interface: CommandEncoder
      Translate a Command into a String
      Specified by:
      encode in interface CommandEncoder