Package megamek.common.options
Class AbstractOptions
java.lang.Object
megamek.common.options.AbstractOptions
- All Implemented Interfaces:
Serializable,IGameOptions
- Direct Known Subclasses:
BasicGameOptions,PartialRepairs,PilotOptions,Quirks,SimulationOptions,WeaponQuirks
Parent class for options settings
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IBasicOptionGroupprotected IBasicOptionGroupprotected voidaddOption(IBasicOptionGroup group, String name, boolean defaultValue) protected voidaddOption(IBasicOptionGroup group, String name, float defaultValue) protected voidaddOption(IBasicOptionGroup group, String name, int defaultValue) protected voidaddOption(IBasicOptionGroup group, String name, int type, Object defaultValue) protected voidaddOption(IBasicOptionGroup group, String name, String defaultValue) protected voidaddOption(IBasicOptionGroup group, String name, Vector<String> defaultValue) booleanbooleanOption(String name) Returns the value of the desired option as thebooleanintcount()Returns a count of all options in this object.intReturns a count of all options in this object with the given group key.floatfloatOption(String name) Returns the value of the desired option as thefloatReturns theEnumerationof the option groups in the options container.Returns the option by name ornullif there is no such optiongetOptionInfo(String name) Returns the UI specific data to allow the user to set the optiongetOptionList(String separator) Returns a string of all the quirk "codes" for this entity, using sep as the separatorgetOptionListString(String separator, String groupKey) Returns a string of all the quirk "codes" for this entity, using sep as the separator, filtering on a specific group key.Returns theEnumerationof the options in this options container.Returns the options info object for this options object.protected abstract AbstractOptionsInfoReturns a collection of all the options in this options container, regardless of whether they're active/selected or not.protected abstract voidintReturns the value of the desired option as theintstringOption(String name) Returns the value of the desired option as theString
-
Field Details
-
optionsHash
-
-
Constructor Details
-
AbstractOptions
protected AbstractOptions()
-
-
Method Details
-
initialize
protected abstract void initialize() -
getOptionMap
-
count
public int count()Description copied from interface:IGameOptionsReturns a count of all options in this object.- Specified by:
countin interfaceIGameOptions- Returns:
- Option count.
-
count
Description copied from interface:IGameOptionsReturns a count of all options in this object with the given group key.- Specified by:
countin interfaceIGameOptions- Parameters:
groupKey- the group key to filter on. Null signifies to return all options indiscriminately.- Returns:
- Option count.
-
getOptionList
Description copied from interface:IGameOptionsReturns a string of all the quirk "codes" for this entity, using sep as the separator- Specified by:
getOptionListin interfaceIGameOptions- Parameters:
separator- The separator to insert between codes, in addition to a space
-
getOptionListString
Description copied from interface:IGameOptionsReturns a string of all the quirk "codes" for this entity, using sep as the separator, filtering on a specific group key.- Specified by:
getOptionListStringin interfaceIGameOptions- Parameters:
separator- The separator to insert between codes, in addition to a spacegroupKey- The group key to use to filter options. Null signifies to return all options indiscriminately.
-
getGroups
Description copied from interface:IGameOptionsReturns theEnumerationof the option groups in the options container.- Specified by:
getGroupsin interfaceIGameOptions- Returns:
Enumerationof theIOptionGroup
-
getOptions
Description copied from interface:IGameOptionsReturns theEnumerationof the options in this options container. The order of options is not specified.- Specified by:
getOptionsin interfaceIGameOptions- Returns:
Enumerationof theIOption
-
getOptionsList
Description copied from interface:IGameOptionsReturns a collection of all the options in this options container, regardless of whether they're active/selected or not. Note that this Collection is unmodifiable, but the contained IOptions are not copied, so changing their state will affect this options object.- Specified by:
getOptionsListin interfaceIGameOptions- Returns:
- A collection containing all IOptions of this options object
-
getOptionInfo
Description copied from interface:IGameOptionsReturns the UI specific data to allow the user to set the option- Specified by:
getOptionInfoin interfaceIGameOptions- Parameters:
name- option name- Returns:
- UI specific data
- See Also:
-
getOption
Description copied from interface:IGameOptionsReturns the option by name ornullif there is no such option- Specified by:
getOptionin interfaceIGameOptions- Parameters:
name- option name- Returns:
- the option or
nullif there is no such option
-
booleanOption
Description copied from interface:IGameOptionsReturns the value of the desired option as theboolean- Specified by:
booleanOptionin interfaceIGameOptions- Parameters:
name- option name- Returns:
- the value of the desired option as the
boolean
-
intOption
Description copied from interface:IGameOptionsReturns the value of the desired option as theint- Specified by:
intOptionin interfaceIGameOptions- Parameters:
name- option name- Returns:
- the value of the desired option as the
int
-
floatOption
Description copied from interface:IGameOptionsReturns the value of the desired option as thefloat- Specified by:
floatOptionin interfaceIGameOptions- Parameters:
name- option name- Returns:
- the value of the desired option as the
float
-
stringOption
Description copied from interface:IGameOptionsReturns the value of the desired option as theString- Specified by:
stringOptionin interfaceIGameOptions- Parameters:
name- option name- Returns:
- the value of the desired option as the
String
-
getOptionsInfo
Description copied from interface:IGameOptionsReturns the options info object for this options object.- Specified by:
getOptionsInfoin interfaceIGameOptions- Returns:
- the options info object for this options object.
-
getOptionsInfoImp
-
addGroup
-
addGroup
-
addOption
-
addOption
-
addOption
-
addOption
-
addOption
-
addOption
-