Package megamek.common.options
Interface IOption
- All Superinterfaces:
IBasicOption,IOptionInfo
- All Known Implementing Classes:
Option
Interface of the settable option. The settable option is used for game options which relate to game behavior and as
well as pilot options which relate to specific stats about a pilot, such as advantages. Game options are the same
across all clients. A settable option's primary purpose is to store a value for the option. Its secondary purpose is
to give the desired options dialog enough data to allow the user to set the option.
- Since:
- April 26, 2002, 10:50 AM
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the value as thebooleanvoidResets the value to its "default" statefloatReturn the value as thefloatReturns default option valuegetOwner()Returns this option container - GameOptions, PilotOptions etcintgetType()Returns option type.intintValue()Return the value as theintvoidsetValue(boolean value) Sets thebooleanvaluevoidsetValue(float value) Sets thefloatvaluevoidsetValue(int value) Sets theintvaluevoidSets the valuevoidSets theStringvalueReturn the value as theStringMethods inherited from interface megamek.common.options.IBasicOption
getName, getValue, is, isAnyOf, isNoneOfMethods inherited from interface megamek.common.options.IOptionInfo
getDescription, getDisplayableName, getDisplayableNameWithValue, getTextFieldLength, isLabelBeforeTextField
-
Field Details
-
BOOLEAN
static final int BOOLEANBoolean option type- See Also:
-
INTEGER
static final int INTEGERInteger option type- See Also:
-
FLOAT
static final int FLOATFloat option type- See Also:
-
STRING
static final int STRINGString option type- See Also:
-
CHOICE
static final int CHOICEChoice option type- See Also:
-
-
Method Details
-
getOwner
IGameOptions getOwner()Returns this option container - GameOptions, PilotOptions etc- Returns:
- option container
-
getType
int getType()Returns option type.- Returns:
- option type
- See Also:
-
getDefault
Object getDefault()Returns default option value- Returns:
- default option value
-
booleanValue
boolean booleanValue()Return the value as theboolean -
intValue
int intValue()Return the value as theint -
floatValue
float floatValue()Return the value as thefloat -
stringValue
String stringValue()Return the value as theString -
setValue
Sets the value- Parameters:
value- value to set
-
setValue
Sets theStringvalue- Parameters:
value- value to set
-
setValue
void setValue(boolean value) Sets thebooleanvalue- Parameters:
value- value to set
-
setValue
void setValue(int value) Sets theintvalue- Parameters:
value- value to set
-
setValue
void setValue(float value) Sets thefloatvalue- Parameters:
value- value to set
-
clearValue
void clearValue()Resets the value to its "default" state
-