Package VASSAL.build.module
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
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionObscurableOptions(String settings)Create a private set of ObscurableOptions. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidallowAll()voidvoidTranslate a String into aCommandvoiddecodeOptions(String s)Set the current options from an encoded stringvoidTranslate aCommandinto a StringEncode the current ObscurableOptions as a Stringstatic ObscurableOptionsReturn the current global ObscurableOptionsWhen 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 nullbooleanisUnmaskable(String id)voidDeprecated, for removal: This API element is subject to removal in a future version.No replacementvoidsetup(boolean gameStarting)Notify the GameComponent that a game has started/ended
-
Field Details
-
COMMAND_ID
- See Also:
- Constant Field Values
-
PREFS_KEY
- See Also:
- Constant Field Values
-
-
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:CommandEncoderTranslate a String into aCommand- Specified by:
decodein interfaceCommandEncoder
-
encode
Description copied from interface:CommandEncoderTranslate aCommandinto a String- Specified by:
encodein 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: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)Description copied from interface:GameComponentNotify the GameComponent that a game has started/ended- Specified by:
setupin 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
-