Class ObscurableOptions

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

public class ObscurableOptions extends Object implements CommandEncoder, GameComponent
Determines whether players are allowed to unmask other players pieces. The module designer may set the option to always on, always off, or let the players determine it with a Preferences setting.
  • Field Details

  • Constructor Details

    • ObscurableOptions

      public ObscurableOptions(String settings)
      Create a private set of ObscurableOptions. If no setting are passed, use the current global settings.
      Parameters:
      settings - encoded settings
  • Method Details

    • getInstance

      public static ObscurableOptions getInstance()
      Return the current global ObscurableOptions
      Returns:
      global Options
    • allowSome

      public void allowSome(String preferencesPrompt)
    • setPrompt

      @Deprecated(since="2020-10-27", forRemoval=true) public void setPrompt(String preferencesPrompt)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No replacement
      Set the text accompanying the "Allow opponent to unmask" control in the Preferences No longer required with new Configurers. Caused double-up label in config display.
    • allowAll

      public void allowAll()
    • allowNone

      public void allowNone()
    • allow

      public void allow(String id)
    • disallow

      public void disallow(String id)
    • 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
    • encodeOptions

      public String encodeOptions()
      Encode the current ObscurableOptions as a String
      Returns:
      encoded options
    • decodeOptions

      public void decodeOptions(String s)
      Set the current options from an encoded string
      Parameters:
      s - encoded string
    • 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)
      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
    • isUnmaskable

      public boolean isUnmaskable(String id)
      Returns:
      true if pieces belonging to the given id are unmaskable by other players