Skip to content

Class endstone::Registry::Type

ClassList > endstone > Registry > Type

CRTP base for registry-backed types identified by an Identifier .More...

  • #include <endstone/registry.h>

Inherited by the following classes: endstone::ActorType, endstone::BlockType, endstone::Enchantment, endstone::ItemType

Public Types

Type Name
typedef Identifier< T > Id

Public Functions

Type Name
virtual Id getId () const = 0
Return the identifier of this object.
virtual std::string getTranslationKey () const = 0
Get the translation key, suitable for use in a translation component.
operator Id () const
bool operator!= (const Id & other) const
bool operator!= (const T & other) const
bool operator== (const Id & other) const
bool operator== (const T & other) const
virtual ~Type () = default

Public Static Functions

Type Name
const T * get (Id id)
Look up a registry entry by identifier.

Detailed Description

Provides getId(), getTranslationKey() pure virtual declarations, comparison operators, implicit conversion to Id, and a static get() method.

Public Types Documentation

typedef Id

using endstone::Registry< T >::Type::Id =  Identifier<T>;

Public Functions Documentation

function getId

Return the identifier of this object.

virtual Id endstone::Registry::Type::getId () const = 0

Returns:

this object's identifier


function getTranslationKey

Get the translation key, suitable for use in a translation component.

virtual std::string endstone::Registry::Type::getTranslationKey () const = 0

Returns:

the translation key


function operator Id

inline endstone::Registry::Type::operator Id () const

function operator!=

inline bool endstone::Registry::Type::operator!= (
    const  Id & other
) const

function operator!=

inline bool endstone::Registry::Type::operator!= (
    const  T & other
) const

function operator==

inline bool endstone::Registry::Type::operator== (
    const  Id & other
) const

function operator==

inline bool endstone::Registry::Type::operator== (
    const  T & other
) const

function ~Type

virtual endstone::Registry::Type::~Type () = default

Public Static Functions Documentation

function get

Look up a registry entry by identifier.

static inline const  T * endstone::Registry::Type::get (
    Id id
) 

Parameters:

Returns:

Pointer to the entry, or nullptr if not found.



The documentation for this class was generated from the following file include/endstone/registry.h