![]() |
NDEVR
API Documentation
|
A program-defined unit that can be used for some specific task different from a program-wide unit. More...
Public Member Functions | |
| BasicCustomUnit (const StringView &id, const TranslatedString &title, UnitCategory type) | |
| Constructs a BasicCustomUnit with the given identifier, title, and unit category. | |
| virtual ConstPointer< Unit > | defaultUnit (UnitManager &) const override |
| Returns the default unit for this custom unit. | |
| virtual void | finishReadingINI (UnitManager &manager) override |
| Resolves the unit from the INI-stored name after reading INI data. | |
| Buffer< ConstPointer< UnitOption > > | options (UnitManager &manager) const override |
| Returns the available unit options for this custom unit. | |
| virtual void | prepareForINI (const UnitManager &manager) override |
| Prepares internal state for INI serialization by capturing the current unit name. | |
| virtual void | setupINI (INIFactory &ini) override |
| Registers this custom unit's settings with the given INI factory. | |
| virtual TranslatedString | title () const override |
| Returns the display title for this custom unit. | |
| virtual Resource< ConstPointer< Unit > > & | unitResource (UnitManager &manager) override |
| Returns a mutable reference to the resource holding the current unit. | |
| Public Member Functions inherited from CustomUnit | |
| CustomUnit (const StringView &id, const TranslatedString &name, UnitCategory unit_type) | |
| Constructs a CustomUnit with the given identifier, name, and unit category. | |
| virtual | ~CustomUnit () |
| Virtual destructor. | |
| virtual ConstPointer< Unit > | currentUnit () |
| Returns the current unit without a manager context. | |
| virtual ConstPointer< Unit > | currentUnit (UnitManager &manager) |
| Returns the current unit using the given manager context. | |
| virtual void | resetToDefault (UnitManager &) |
| Resets this custom unit to its default value. | |
Protected Attributes | |
| String | m_ini_unit_name |
| The unit name stored in INI for serialization. | |
| TranslatedString | m_title |
| The translated display title. | |
| Resource< ConstPointer< Unit > > | m_unit |
| The resource holding the current unit selection. | |
Additional Inherited Members | |
| Public Attributes inherited from CustomUnit | |
| String | id |
| The unique string identifier of this custom unit. | |
| TranslatedString | name |
| The translated display name of this custom unit. | |
| UnitCategory | unit_type |
| The category of unit this custom unit belongs to. | |
A program-defined unit that can be used for some specific task different from a program-wide unit.
Class: BaseValues
Definition at line 298 of file UnitManager.h.
| BasicCustomUnit::BasicCustomUnit | ( | const StringView & | id, |
| const TranslatedString & | title, | ||
| UnitCategory | type ) |
Constructs a BasicCustomUnit with the given identifier, title, and unit category.
| [in] | id | The unique string identifier for this custom unit. |
| [in] | title | The translated display title for this custom unit. |
| [in] | type | The category of unit this custom unit belongs to. |
References title().
|
nodiscardoverridevirtual |
Returns the default unit for this custom unit.
| [in] | manager | The UnitManager providing unit context. |
Implements CustomUnit.
|
overridevirtual |
Resolves the unit from the INI-stored name after reading INI data.
| [in] | manager | The UnitManager providing unit context. |
Reimplemented from CustomUnit.
|
nodiscardoverridevirtual |
Returns the available unit options for this custom unit.
| [in] | manager | The UnitManager providing unit context. |
Implements CustomUnit.
|
overridevirtual |
Prepares internal state for INI serialization by capturing the current unit name.
| [in] | manager | The UnitManager providing unit context. |
Reimplemented from CustomUnit.
|
overridevirtual |
Registers this custom unit's settings with the given INI factory.
| [in] | ini | The INI factory to register with. |
Implements CustomUnit.
|
inlinenodiscardoverridevirtual |
Returns the display title for this custom unit.
Reimplemented from CustomUnit.
Definition at line 327 of file UnitManager.h.
References m_title.
Referenced by BasicCustomUnit().
|
nodiscardoverridevirtual |
Returns a mutable reference to the resource holding the current unit.
| [in] | manager | The UnitManager providing unit context. |
Implements CustomUnit.