Package VASSAL.build.module
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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNewGameIndicator.MarkGameNotNew -
Constructor Summary
Constructors Constructor Description NewGameIndicator(String command) -
Method Summary
Modifier and Type Method Description Commanddecode(String command)Translate a String into aCommandStringencode(Command c)Translate aCommandinto a StringCommandgetRestoreCommand()When saving a game, each GameComponent should return aCommandthat, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return nullbooleanisNewGame()voidsetup(boolean gameStarting)Notify the GameComponent that a game has started/ended
-
Constructor Details
-
NewGameIndicator
-
-
Method Details
-
getRestoreCommand
Description copied from interface:GameComponentWhen saving a game, each GameComponent should return aCommandthat, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return null- Specified by:
getRestoreCommandin interfaceGameComponent
-
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:GameComponentNotify the GameComponent that a game has started/ended- Specified by:
setupin interfaceGameComponent- Parameters:
gameStarting- if true, a game is starting. If false, then a game is ending
-
decode
Description copied from interface:CommandEncoderTranslate a String into aCommand- Specified by:
decodein interfaceCommandEncoder
-
encode
Description copied from interface:CommandEncoderTranslate aCommandinto a String- Specified by:
encodein interfaceCommandEncoder
-