Lodestone.Level
Loading...
Searching...
No Matches
lodestone::level::properties::AbstractProperty Class Referenceabstract

#include <AbstractProperty.h>

Inheritance diagram for lodestone::level::properties::AbstractProperty:

Public Member Functions

virtual constexpr ~AbstractProperty ()=default
virtual constexpr const lodestone::common::registry::Identifier * getTypeName () const
virtual constexpr size_t hash () const =0
virtual constexpr bool equals (const AbstractProperty *rhs) const
template<typename T>
requires std::is_base_of_v<AbstractProperty, T>
constexpr const T * as () const
constexpr bool operator== (const AbstractProperty &rhs) const

Protected Member Functions

constexpr AbstractProperty ()=default

Constructor & Destructor Documentation

◆ AbstractProperty()

lodestone::level::properties::AbstractProperty::AbstractProperty ( )
constexprprotecteddefault

◆ ~AbstractProperty()

virtual constexpr lodestone::level::properties::AbstractProperty::~AbstractProperty ( )
constexprvirtualdefault

Member Function Documentation

◆ as()

template<typename T>
requires std::is_base_of_v<AbstractProperty, T>
const T * lodestone::level::properties::AbstractProperty::as ( ) const
inlineconstexpr
36 {
37 return dynamic_cast<const T *>(this);
38 }

◆ equals()

virtual constexpr bool lodestone::level::properties::AbstractProperty::equals ( const AbstractProperty * rhs) const
inlineconstexprvirtual

Reimplemented in lodestone::level::properties::TemplatedProperty< T >.

24 {
25 if (rhs == nullptr)
26 return false;
27
28 if (typeid(rhs) != typeid(this))
29 return false;
30
31 return true;
32 }

◆ getTypeName()

virtual constexpr const lodestone::common::registry::Identifier * lodestone::level::properties::AbstractProperty::getTypeName ( ) const
inlineconstexprvirtual

Reimplemented in lodestone::level::properties::TemplatedProperty< T >.

18 {
20 };
constexpr common::registry::Identifier ABSTRACT_PROPERTY
Definition Identifiers.h:11

◆ hash()

virtual constexpr size_t lodestone::level::properties::AbstractProperty::hash ( ) const
constexprpure virtual

◆ operator==()

bool lodestone::level::properties::AbstractProperty::operator== ( const AbstractProperty & rhs) const
inlineconstexpr
40 {
41 return this->equals(&rhs);
42 }
virtual constexpr bool equals(const AbstractProperty *rhs) const
Definition AbstractProperty.h:24

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