|
stmm-games-doc
0.32.0
|

Public Member Functions | |
| OwnerType | getOwnerType () const noexcept |
| const std::string & | getName () const noexcept |
| Variant | getDefaultValue () const noexcept |
| const std::string & | getDesc () const noexcept |
| virtual bool | isValidValue (const Variant &oValue) const noexcept=0 |
| Whether the value is valid for this option. More... | |
| virtual std::string | getValueAsCode (const Variant &oValue) const noexcept=0 |
| Return a value as code. More... | |
| virtual std::pair< Variant, std::string > | getValueFromCode (const std::string &sCode) const noexcept=0 |
| Convert code to value. More... | |
| virtual std::string | getValueAsDescriptive (const Variant &oValue) const noexcept=0 |
| Return the value as a human readable string. More... | |
| virtual bool | allowsRange () const noexcept |
| Whether range of values is supported. More... | |
| virtual std::pair< Variant, std::string > | getValueFromString (const std::string &sValue) const noexcept=0 |
| Convert string to value. More... | |
| bool | isReadonly () const noexcept |
| bool | isVisible () const noexcept |
| const std::vector< std::pair< shared_ptr< Option >, std::vector< Variant > > > & | getMastersValues () const noexcept |
| Get the masters and their corresonding values for which this option is enabled. More... | |
| bool | isSlave () const noexcept |
Protected Member Functions | |
| virtual | ~Option ()=default |
| Option (OwnerType eOwnerType, const std::string &sName, const Variant &oDefaultValue, const std::string &sDesc) noexcept | |
| Constructor. More... | |
| Option (OwnerType eOwnerType, const std::string &sName, const Variant &oDefaultValue, const std::string &sDesc, bool bReadOnly, bool bVisible, const shared_ptr< Option > &refMaster, const std::vector< Variant > &aMasterValues) noexcept | |
| One master constructor. More... | |
| Option (OwnerType eOwnerType, const std::string &sName, const Variant &oDefaultValue, const std::string &sDesc, bool bReadOnly, bool bVisible, const std::vector< std::pair< shared_ptr< Option >, std::vector< Variant >>> &aMastersValues) noexcept | |
| Generic constructor. More... | |
|
protectedvirtualdefault |
|
protectednoexcept |
Constructor.
The option is created visible and not readonly.
| eOwnerType | The owner type. |
| sName | The option name. |
| oDefaultValue | The default value. |
| sDesc | The description of the option. |
|
protectednoexcept |
One master constructor.
If bReadOnly is true the preferences dialog might show it but not allow to set its value.
If bVisible is false the preferences dialog doesn't show the option.
If the instance has a master (it's a slave) it keeps a strong reference to it. A master option cannot be slave itself. If refMaster is not null aMasterValues cannot contain duplicates.
| eOwnerType | The owner type. |
| sName | The option name. |
| oDefaultValue | The default value. |
| sDesc | The description of the option. |
| bReadOnly | Whether readonly. |
| bVisible | Whether visible. |
| refMaster | The master option. Can be null. |
| aMasterValues | The values of the master option for which this option is enabled. Must be empty if refMaster is null. |
|
protectednoexcept |
Generic constructor.
If bReadOnly is true the preferences dialog might show it but not allow to set its value.
If bVisible is false the preferences dialog doesn't show the option.
If the instance has at least a master (aMastersValues is not empty) it is a slave, and it keeps a strong reference to those masters. A master option cannot be slave itself. For each master the values for which the slave is enabled cannot contain duplicates.
| eOwnerType | The owner type. |
| sName | The option name. |
| oDefaultValue | The default value. |
| sDesc | The description of the option. |
| bReadOnly | Whether readonly. |
| bVisible | Whether visible. |
| aMastersValues | The values for each master option for which this option is enabled. Can be empty. Value: (refMaster, aMasterValues). |
|
inlinevirtualnoexcept |
Whether range of values is supported.
The default implementation returns false.
Reimplemented in stmg::IntOption.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Get the masters and their corresonding values for which this option is enabled.
All masters must have one of the given values for this option to be enabled.
|
inlinenoexcept |
|
inlinenoexcept |
|
pure virtualnoexcept |
Return a value as code.
| oValue | The value. |
Implemented in stmg::EnumOption, stmg::IntOption, and stmg::BoolOption.
|
pure virtualnoexcept |
Return the value as a human readable string.
| oValue | The value. |
Implemented in stmg::EnumOption, stmg::IntOption, and stmg::BoolOption.
|
pure virtualnoexcept |
Convert code to value.
| sCode | The code. |
Implemented in stmg::EnumOption, stmg::IntOption, and stmg::BoolOption.
|
pure virtualnoexcept |
Convert string to value.
| sValue | The string representation. Cannot be empty. |
Implemented in stmg::EnumOption, stmg::IntOption, and stmg::BoolOption.
|
inlinenoexcept |
|
inlinenoexcept |
|
pure virtualnoexcept |
Whether the value is valid for this option.
| oValue | The value. |
Implemented in stmg::EnumOption, stmg::IntOption, and stmg::BoolOption.
|
inlinenoexcept |
1.8.13