API Documentation
Loading...
Searching...
No Matches
CustomUnit Class Referenceabstract

A program-defined unit that can be used for some specific task different from a program-wide unit. More...

#include <UnitManager.h>

Inheritance diagram for CustomUnit:
[legend]
Collaboration diagram for CustomUnit:
[legend]

Public Member Functions

virtual ConstPointer< UnitcurrentUnit ()
 
virtual ConstPointer< UnitcurrentUnit (UnitManager &manager)
 
 CustomUnit (const String &id, const TranslatedString &name, UnitCategory unit_type)
 
virtual ConstPointer< UnitdefaultUnit (UnitManager &) const =0
 
virtual void finishReadingINI (UnitManager &)
 
virtual Buffer< ConstPointer< UnitOption > > options (UnitManager &manager) const =0
 
virtual void prepareForINI (const UnitManager &)
 
virtual void resetToDefault (UnitManager &)
 
virtual void setupINI (INIFactory &)=0
 
virtual TranslatedString title () const
 
virtual Resource< ConstPointer< Unit > > & unitResource (UnitManager &manager)=0
 
virtual ~CustomUnit ()
 

Public Attributes

String id
 
TranslatedString name
 
UnitCategory unit_type
 

Detailed Description

A program-defined unit that can be used for some specific task different from a program-wide unit.


Class: BaseValues

Constructor & Destructor Documentation

◆ CustomUnit()

CustomUnit ( const String & id,
const TranslatedString & name,
UnitCategory unit_type )
inline

◆ ~CustomUnit()

virtual ~CustomUnit ( )
inlinevirtual

Member Function Documentation

◆ currentUnit() [1/2]

virtual ConstPointer< Unit > currentUnit ( )
virtual

◆ currentUnit() [2/2]

virtual ConstPointer< Unit > currentUnit ( UnitManager & manager)
virtual

Reimplemented in ReferenceCustomUnit.

◆ defaultUnit()

virtual ConstPointer< Unit > defaultUnit ( UnitManager & ) const
nodiscardpure virtual

Implemented in BasicCustomUnit, and ReferenceCustomUnit.

◆ finishReadingINI()

virtual void finishReadingINI ( UnitManager & )
inlinevirtual

Reimplemented in BasicCustomUnit, and ReferenceCustomUnit.

◆ options()

virtual Buffer< ConstPointer< UnitOption > > options ( UnitManager & manager) const
nodiscardpure virtual

Implemented in BasicCustomUnit, and ReferenceCustomUnit.

◆ prepareForINI()

virtual void prepareForINI ( const UnitManager & )
inlinevirtual

Reimplemented in BasicCustomUnit, and ReferenceCustomUnit.

◆ resetToDefault()

virtual void resetToDefault ( UnitManager & )
virtual

Reimplemented in ReferenceCustomUnit.

◆ setupINI()

virtual void setupINI ( INIFactory & )
pure virtual

Implemented in BasicCustomUnit, and ReferenceCustomUnit.

◆ title()

virtual TranslatedString title ( ) const
inlinenodiscardvirtual

Reimplemented in BasicCustomUnit.

◆ unitResource()

virtual Resource< ConstPointer< Unit > > & unitResource ( UnitManager & manager)
nodiscardpure virtual

Implemented in BasicCustomUnit, and ReferenceCustomUnit.

Member Data Documentation

◆ id

String id

◆ name

◆ unit_type

UnitCategory unit_type

The documentation for this class was generated from the following file: