Game Engine
Architected a C++ game engine with a runtime reflection system - employing Chain of
|
#include <Attributed.h>
Public Member Functions | |
Attributed ()=delete | |
Attributed (std::function< ClassDefinition()> defGenerator, const RTTI::IdType &idType) | |
Constructor that initializes class attributes based on the provided class definition generator. | |
Attributed (const Attributed &other) | |
Copy constructor for Attributed. | |
Attributed (Attributed &&other) noexcept | |
Move constructor for Attributed. | |
Attributed & | operator= (const Attributed &rhs) |
Copy assignment operator. | |
Attributed & | operator= (Attributed &&rhs) noexcept |
Move assignment operator. | |
virtual | ~Attributed ()=default |
Attributed * | Clone () const override |
Creates a deep copy of this Attributed object. | |
bool | IsAttribute (const string &key) |
Checks if a given key is an attribute. | |
bool | IsClassAttribute (const string &key) |
Checks if a given key is a class attribute. | |
bool | IsInstanceAttribute (const string &key) |
Checks if a given key is an instance attribute. | |
Datum & | AppendInstanceAttribute (const string &key) |
Appends a new instance attribute. | |
std::vector< string > | Attributes () |
Retrieves all attribute names. | |
std::vector< string > | ClassAttributes () |
Retrieves all class attribute names. | |
std::vector< string > | InstanceAttributes () |
Retrieves all instance attribute names. | |
Public Member Functions inherited from Fiea::Engine::Content::Scope | |
Scope ()=default | |
Scope (const Scope &rhs) | |
Copy constructor. | |
Scope (Scope &&rhs) noexcept | |
Move constructor. | |
Scope & | operator= (const Scope &rhs) |
Copy assignment operator. | |
Scope & | operator= (Scope &&rhs) noexcept |
Move assignment operator. | |
virtual | ~Scope () |
Destructor. Clears the Scope. | |
bool | operator== (const Scope &rhs) const |
Equality operator. | |
bool | operator!= (const Scope &rhs) const |
Inequality operator. | |
Datum * | Find (const string &key) |
Finds a Datum by key. | |
const Datum * | Find (const string &key) const |
Finds a Datum by key (const version). | |
Datum & | Append (const string &key) |
Appends a new Datum with the given key. | |
void | RemoveDatum (const string &key) |
Datum * | Search (const string &key) |
Datum & | operator[] (const string &key) |
Overloads operator[] for accessing a Datum by key. If the key does not exist in the Scope, it is appended. | |
Datum & | operator[] (size_t idx) |
Overloads operator[] for accessing a Datum by index. Retrieves the Datum corresponding to the given index in the ordered list. | |
size_t | Size () const |
Returns the number of key-value pairs in the Scope. | |
void | Clear () |
Clears all data in the Scope. | |
Scope & | AppendScope (const string &key, Scope *scope=nullptr) |
Appends a new Scope as a child under the specified key. | |
void | Adopt (const string &key, Scope &child) |
Adopts an existing Scope as a child under the specified key. | |
Scope * | GetParent () const |
void | SetParent (Scope &parent) |
Scope * | Orphan () |
Removes this Scope from its parent. | |
Datum * | FindContainedScope (const Scope &child, size_t &idx) |
Finds the Datum that contains the specified child Scope. | |
const Datum * | FindContainedScope (const Scope &child, size_t &idx) const |
Finds the Datum that contains the specified child Scope (const version). | |
bool | IsAncestorOf (const Scope &descendent) const |
Checks if this Scope is an ancestor of the specified descendent Scope. | |
bool | IsDescendentOf (const Scope &ancestor) const |
Checks if this Scope is a descendent of the specified ancestor Scope. | |
Public Member Functions inherited from Fiea::Engine::RTTI | |
RTTI ()=default | |
RTTI (const RTTI &)=default | |
RTTI & | operator= (const RTTI &)=default |
RTTI (RTTI &&) noexcept=default | |
RTTI & | operator= (RTTI &&) noexcept=default |
virtual | ~RTTI ()=default |
virtual IdType | TypeIdInstance () const =0 |
virtual bool | Is (IdType) const |
template<typename T> | |
T * | As () |
template<typename T> | |
const T * | As () const |
virtual std::string | ToString () const |
virtual bool | Equals (const RTTI *rhs) const |
Additional Inherited Members | |
Public Types inherited from Fiea::Engine::RTTI | |
using | IdType = std::size_t |
Protected Member Functions inherited from Fiea::Engine::Content::Scope | |
std::vector< const string * > | GetOrderedDatums () |
|
delete |
|
explicit |
Fiea::Engine::Content::Attributed::Attributed | ( | const Attributed & | other | ) |
Copy constructor for Attributed.
other | The Attributed object to copy from. |
|
noexcept |
Move constructor for Attributed.
other | The Attributed object to move from. |
|
virtualdefault |
Appends a new instance attribute.
key | The name of the new instance attribute. |
std::vector< string > Fiea::Engine::Content::Attributed::Attributes | ( | ) |
Retrieves all attribute names.
std::vector< string > Fiea::Engine::Content::Attributed::ClassAttributes | ( | ) |
Retrieves all class attribute names.
|
nodiscardoverridevirtual |
Creates a deep copy of this Attributed object.
Reimplemented from Fiea::Engine::Content::Scope.
Reimplemented in Fiea::Engine::GameObject.
std::vector< string > Fiea::Engine::Content::Attributed::InstanceAttributes | ( | ) |
Retrieves all instance attribute names.
bool Fiea::Engine::Content::Attributed::IsAttribute | ( | const string & | key | ) |
Checks if a given key is an attribute.
key | The attribute key to check. |
bool Fiea::Engine::Content::Attributed::IsClassAttribute | ( | const string & | key | ) |
Checks if a given key is a class attribute.
key | The attribute key to check. |
bool Fiea::Engine::Content::Attributed::IsInstanceAttribute | ( | const string & | key | ) |
Checks if a given key is an instance attribute.
key | The attribute key to check. |
|
noexcept |
Move assignment operator.
rhs | The Attributed object to move from. |
Attributed & Fiea::Engine::Content::Attributed::operator= | ( | const Attributed & | rhs | ) |
Copy assignment operator.
rhs | The Attributed object to copy from. |