VASSAL.build.module
Class ObscurableOptions

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

public class ObscurableOptions
extends java.lang.Object
implements CommandEncoder, GameComponent

Determines whether players are allowed to un-mask 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.


Inner Class Summary
static class ObscurableOptions.SetAllowed
           
 
Field Summary
static java.lang.String COMMAND_ID
           
static java.lang.String PREFS_KEY
           
 
Method Summary
 void allow(java.lang.String id)
           
 void allowAll()
           
 void allowNone()
           
 void allowSome(java.lang.String preferencesPrompt)
           
 Command decode(java.lang.String command)
          Translate a String into a Command
 void disallow(java.lang.String id)
           
 java.lang.String encode(Command c)
          Translate a Command into a String
static ObscurableOptions getInstance()
           
 Command getRestoreCommand()
          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
 boolean isUnmaskable(java.lang.String id)
          Return true if pieces belonging to the given id are un-maskable by other players
 void setPrompt(java.lang.String preferencesPrompt)
          Set the text accompanying the "Allow opponent to unmask" control in the Preferences
 void setup(boolean gameStarting)
          Notify the GameComponent that a game has started/ended
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMAND_ID

public static final java.lang.String COMMAND_ID

PREFS_KEY

public static final java.lang.String PREFS_KEY
Method Detail

getInstance

public static ObscurableOptions getInstance()

allowSome

public void allowSome(java.lang.String preferencesPrompt)

setPrompt

public void setPrompt(java.lang.String preferencesPrompt)
Set the text accompanying the "Allow opponent to unmask" control in the Preferences

allowAll

public void allowAll()

allowNone

public void allowNone()

allow

public void allow(java.lang.String id)

disallow

public void disallow(java.lang.String id)

decode

public Command decode(java.lang.String command)
Description copied from interface: CommandEncoder
Translate a String into a Command
Specified by:
decode in interface CommandEncoder

encode

public java.lang.String encode(Command c)
Description copied from interface: CommandEncoder
Translate a Command into a String
Specified by:
encode in interface CommandEncoder

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
Following copied from interface: VASSAL.build.module.GameComponent
Parameters:
gameStarting - if true, a game is starting. If false, then a game is ending

isUnmaskable

public boolean isUnmaskable(java.lang.String id)
Return true if pieces belonging to the given id are un-maskable by other players