Class ObscurableOptions
java.lang.Object
VASSAL.build.module.ObscurableOptions
- All Implemented Interfaces:
GameComponent
,CommandEncoder
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.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionObscurableOptions
(String settings) Create a private set of ObscurableOptions. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
allowAll()
void
void
Translate a String into aCommand
void
Set the current options from an encoded stringvoid
Translate aCommand
into a StringEncode the current ObscurableOptions as a Stringstatic ObscurableOptions
Return the current global ObscurableOptionsWhen 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
isUnmaskable
(String id) void
Deprecated, for removal: This API element is subject to removal in a future version.No replacementvoid
setup
(boolean gameStarting) Notify the GameComponent that a game has started/ended
-
Field Details
-
COMMAND_ID
- See Also:
-
PREFS_KEY
- See Also:
-
-
Constructor Details
-
ObscurableOptions
Create a private set of ObscurableOptions. If no setting are passed, use the current global settings.- Parameters:
settings
- encoded settings
-
-
Method Details
-
getInstance
Return the current global ObscurableOptions- Returns:
- global Options
-
allowSome
-
setPrompt
Deprecated, for removal: This API element is subject to removal in a future version.No replacementSet 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
-
disallow
-
decode
Description copied from interface:CommandEncoder
Translate a String into aCommand
- Specified by:
decode
in interfaceCommandEncoder
-
encode
Description copied from interface:CommandEncoder
Translate aCommand
into a String- Specified by:
encode
in interfaceCommandEncoder
-
encodeOptions
Encode the current ObscurableOptions as a String- Returns:
- encoded options
-
decodeOptions
Set the current options from an encoded string- Parameters:
s
- encoded string
-
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) Description copied from interface:GameComponent
Notify the GameComponent that a game has started/ended- Specified by:
setup
in interfaceGameComponent
- Parameters:
gameStarting
- if true, a game is starting. If false, then a game is ending
-
isUnmaskable
- Returns:
- true if pieces belonging to the given id are unmaskable by other players
-