![]() |
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 | |
| 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 ConstPointer< Unit > | defaultUnit (UnitManager &) const =0 |
| Returns the default unit for this custom unit. | |
| virtual void | finishReadingINI (UnitManager &) |
| Called after INI data has been read to finalize state. | |
| virtual Buffer< ConstPointer< UnitOption > > | options (UnitManager &manager) const =0 |
| Returns the available unit options for this custom unit. | |
| virtual void | prepareForINI (const UnitManager &) |
| Prepares internal state for INI serialization. | |
| virtual void | resetToDefault (UnitManager &) |
| Resets this custom unit to its default value. | |
| virtual void | setupINI (INIFactory &)=0 |
| Registers this custom unit's settings with the given INI factory. | |
| virtual TranslatedString | title () const |
| Returns the translated display title. | |
| virtual Resource< ConstPointer< Unit > > & | unitResource (UnitManager &manager)=0 |
| Returns a mutable reference to the resource holding the current unit. | |
Public Attributes | |
| 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 154 of file UnitManager.h.
|
inline |
Constructs a CustomUnit with the given identifier, name, and unit category.
| [in] | id | The unique string identifier for this custom unit. |
| [in] | name | The translated display name for this custom unit. |
| [in] | unit_type | The category of unit this custom unit belongs to. |
Definition at line 163 of file UnitManager.h.
References id, name, and unit_type.
Referenced by ReferenceCustomUnit::ReferenceCustomUnit().
|
virtual |
Returns the current unit without a manager context.
|
virtual |
Returns the current unit using the given manager context.
| [in] | manager | The UnitManager providing unit context. |
Reimplemented in ReferenceCustomUnit.
|
nodiscardpure virtual |
Returns the default unit for this custom unit.
| [in] | manager | The UnitManager providing unit context. |
Implemented in BasicCustomUnit, and ReferenceCustomUnit.
|
inlinevirtual |
Called after INI data has been read to finalize state.
| [in] | manager | The UnitManager providing unit context. |
Reimplemented in BasicCustomUnit, and ReferenceCustomUnit.
Definition at line 211 of file UnitManager.h.
|
nodiscardpure virtual |
Returns the available unit options for this custom unit.
| [in] | manager | The UnitManager providing unit context. |
Implemented in BasicCustomUnit, and ReferenceCustomUnit.
|
inlinevirtual |
Prepares internal state for INI serialization.
| [in] | manager | The UnitManager providing unit context. |
Reimplemented in BasicCustomUnit, and ReferenceCustomUnit.
Definition at line 196 of file UnitManager.h.
|
virtual |
Resets this custom unit to its default value.
| [in] | manager | The UnitManager providing unit context. |
Reimplemented in ReferenceCustomUnit.
|
pure virtual |
Registers this custom unit's settings with the given INI factory.
| [in] | ini | The INI factory to register with. |
Implemented in BasicCustomUnit, and ReferenceCustomUnit.
|
inlinenodiscardvirtual |
Returns the translated display title.
Reimplemented in BasicCustomUnit.
Definition at line 179 of file UnitManager.h.
References name.
|
nodiscardpure virtual |
Returns a mutable reference to the resource holding the current unit.
| [in] | manager | The UnitManager providing unit context. |
Implemented in BasicCustomUnit, and ReferenceCustomUnit.