Class GameRefresher

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

public final class GameRefresher extends Object implements CommandEncoder, GameComponent
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 Details

  • Constructor Details

    • GameRefresher

      public GameRefresher(GpIdSupport gpIdSupport)
  • Method Details

    • encode

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

      public Command decode(String s)
      Deserializes string command info into a Deck Reposition Command.
      Specified by:
      decode in interface CommandEncoder
      Parameters:
      s - String for a Deck Reposition command string
      Returns:
      Deck Reposition Command object
    • addTo

      public void addTo(AbstractConfigurable parent)
    • getRefreshAction

      public Action 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

      public void log(String message)
    • getCurrentGameRefresherPieces

      public List<GamePiece> getCurrentGameRefresherPieces()
    • execute

      public void execute(Set<String> options, Command command) throws IllegalBuildException
      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

      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
    • setup

      public void setup(boolean gameStarting)
      Enable Refresh menu item when game is running only.
      Specified by:
      setup in interface GameComponent
      Parameters:
      gameStarting - if true, a game is starting. If false, then a game is ending