![]() |
NDEVR
API Documentation
|
A definition of how to describe a particular set of data to a custom category of unit. More...
Public Member Functions | |
| BasicUnitOption (const ConstPointer< Unit > &unit, const TranslatedString &custom_title=TranslatedString()) | |
| Constructs a BasicUnitOption from a unit and an optional custom title. | |
| virtual Buffer< ConstPointer< UnitOption > > & | editSubOptions () |
| Returns a mutable reference to the sub-options for editing. | |
| virtual bool | hasMemberUnit (const ConstPointer< Unit > &unit) const final override |
| Checks whether the given unit matches this option or any sub-option. | |
| virtual Buffer< ConstPointer< UnitOption > > | subOptions () const final override |
| Returns the sub-options for this unit option. | |
| virtual TranslatedString | title () const final override |
| Returns the display title, using the custom title if set. | |
| virtual ConstPointer< Unit > | unit () const final override |
| Returns the base unit for this option. | |
| Public Member Functions inherited from UnitOption | |
| UnitOption (const StringView &id, const TranslatedString &name) | |
| Constructs a UnitOption with the given identifier and display name. | |
| virtual | ~UnitOption () |
| Virtual destructor. | |
| virtual ConstPointer< Unit > | unit (const ConstPointer< Unit > &) const |
| Returns a unit resolved relative to the given unit context. | |
Public Attributes | |
| ConstPointer< Unit > | base_unit |
| The underlying unit this option wraps. | |
| TranslatedString | custom_title |
| An optional custom display title. | |
| Public Attributes inherited from UnitOption | |
| String | id |
| The unique string identifier of this unit option. | |
| TranslatedString | name |
| The translated display name of this unit option. | |
Protected Attributes | |
| Buffer< ConstPointer< UnitOption > > | m_sub_options |
| Child sub-options within this unit option. | |
A definition of how to describe a particular set of data to a custom category of unit.
Definition at line 70 of file UnitManager.h.
|
inline |
Constructs a BasicUnitOption from a unit and an optional custom title.
| [in] | unit | The unit this option represents. |
| [in] | custom_title | An optional custom translated title to override the unit name. |
Definition at line 78 of file UnitManager.h.
References UnitOption::UnitOption(), base_unit, custom_title, UnitOption::name, and unit().
|
inlinevirtual |
Returns a mutable reference to the sub-options for editing.
Definition at line 108 of file UnitManager.h.
References m_sub_options.
|
finaloverridevirtual |
Checks whether the given unit matches this option or any sub-option.
| [in] | unit | The unit to check membership for. |
Implements UnitOption.
References hasMemberUnit(), and unit().
Referenced by hasMemberUnit().
|
inlinefinaloverridevirtual |
Returns the sub-options for this unit option.
Reimplemented from UnitOption.
Definition at line 103 of file UnitManager.h.
References m_sub_options.
|
finaloverridevirtual |
Returns the display title, using the custom title if set.
Reimplemented from UnitOption.
|
inlinefinaloverridevirtual |
Returns the base unit for this option.
Implements UnitOption.
Definition at line 98 of file UnitManager.h.
References base_unit, and unit().
Referenced by BasicUnitOption(), hasMemberUnit(), and unit().