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 TypeMethodDescriptionvoid
addTo
(AbstractConfigurable parent) Translate a String into aCommand
Translate aCommand
into a Stringvoid
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.List<VASSAL.build.module.GameRefresher.Refresher>
Build a list of all the Refreshables in the module in Visual order (bottom to top) so that we can ensure the visibility order of the refreshed pieces does not change.When saving a game, each GameComponent should return aCommand
that, when executed, restores the GameComponent to its state when the game was saved If this component has no persistent state, return nullboolean
boolean
void
void
setup
(boolean gameStarting) Enable Refresh menu item when game is running only.void
start()
-
Field Details
-
COMMAND_PREFIX
- See Also:
-
-
Constructor Details
-
GameRefresher
-
-
Method Details
-
getModuleDrawPiles
-
encode
Description copied from interface:CommandEncoder
Translate aCommand
into a String- Specified by:
encode
in interfaceCommandEncoder
-
decode
Description copied from interface:CommandEncoder
Translate a String into aCommand
- Specified by:
decode
in interfaceCommandEncoder
-
addTo
-
getRefreshAction
-
isTestMode
public boolean isTestMode() -
isDeleteNoMap
public boolean isDeleteNoMap() -
start
public void start() -
log
-
getRefreshables
Build a list of all the Refreshables in the module in Visual order (bottom to top) so that we can ensure the visibility order of the refreshed pieces does not change. A Refreshable can be one of - Stack - Deck - Mat with contained Cargo - Single non-Mat unstacked piece- Returns:
-
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:GameComponent
When saving a game, each GameComponent should return aCommand
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 interfaceGameComponent
-
setup
public void setup(boolean gameStarting) Enable Refresh menu item when game is running only.- Specified by:
setup
in interfaceGameComponent
- Parameters:
gameStarting
- if true, a game is starting. If false, then a game is ending
-