Package VASSAL.build.module
Class GameRefresher
java.lang.Object
VASSAL.build.module.GameRefresher
- All Implemented Interfaces:
GameComponent,CommandEncoder
GameRefresher Replace all counters in the same game with the current version
of the counters defined in the module
Note: Counters that are Hidden or Obscured to us cannot be updated.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTo(AbstractConfigurable parent)Deserializes string command info into a Deck Reposition Command.Translate aCommandinto a StringvoidThis method is used by PredefinedSetup.refresh() to update a PredefinedSetup in a GameModule The default execute() method calls: GameModule.getGameModule().getGameState().getAllPieces() to set the pieces list, this method provides an alternative way to specify which pieces should be refreshed.Removes this component from a Buildable parent.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 nullbooleanbooleanvoidvoidsetup(boolean gameStarting)Enable Refresh menu item when game is running only.voidstart()
-
Field Details
-
COMMAND_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Details
-
GameRefresher
-
-
Method Details
-
encode
Description copied from interface:CommandEncoderTranslate aCommandinto a String- Specified by:
encodein interfaceCommandEncoder
-
decode
Deserializes string command info into a Deck Reposition Command.- Specified by:
decodein interfaceCommandEncoder- Parameters:
s- String for a Deck Reposition command string- Returns:
- Deck Reposition Command object
-
addTo
-
getRefreshAction
Removes this component from a Buildable parent.- Parameters:
parent- - the Map to remove the Flare from.
-
isTestMode
public boolean isTestMode() -
isDeleteNoMap
public boolean isDeleteNoMap() -
start
public void start() -
log
-
getCurrentGameRefresherPieces
-
execute
This method is used by PredefinedSetup.refresh() to update a PredefinedSetup in a GameModule The default execute() method calls: GameModule.getGameModule().getGameState().getAllPieces() to set the pieces list, this method provides an alternative way to specify which pieces should be refreshed.- Throws:
IllegalBuildException- - if we get a gpIdChecker error
-
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
-
setup
public void setup(boolean gameStarting)Enable Refresh menu item when game is running only.- Specified by:
setupin interfaceGameComponent- Parameters:
gameStarting- if true, a game is starting. If false, then a game is ending
-