Game Engine
Architected a C++ game engine with a runtime reflection system - employing Chain of
|
#include <Scope.h>
Public Member Functions | |
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. | |
virtual Scope * | Clone () const |
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 |
Protected Member Functions | |
std::vector< const string * > | GetOrderedDatums () |
Additional Inherited Members | |
Public Types inherited from Fiea::Engine::RTTI | |
using | IdType = std::size_t |
|
default |
Fiea::Engine::Content::Scope::Scope | ( | const Scope & | rhs | ) |
|
noexcept |
|
virtual |
void Fiea::Engine::Content::Scope::Clear | ( | ) |
Clears all data in the Scope.
|
virtual |
Reimplemented in Fiea::Engine::Content::Attributed, Fiea::Engine::GameObject, Fiea::Engine::Tests::Support::AttributeBox, Fiea::Engine::Tests::Support::AttributeBoxPlus, Microsoft::VisualStudio::CppUnitTestFramework::AttributeBox, and Microsoft::VisualStudio::CppUnitTestFramework::AttributeBoxPlus.
Finds the Datum that contains the specified child Scope.
child | A reference to the child Scope to search for. |
idx | [out] The index within the Datum where the child was found. Set to -1 if not found. |
const Datum * Fiea::Engine::Content::Scope::FindContainedScope | ( | const Scope & | child, |
size_t & | idx ) const |
Finds the Datum that contains the specified child Scope (const version).
child | A reference to the child Scope to search for. |
idx | [out] The index within the Datum where the child was found. Set to -1 if not found. |
|
inlineprotected |
Scope * Fiea::Engine::Content::Scope::GetParent | ( | ) | const |
bool Fiea::Engine::Content::Scope::IsAncestorOf | ( | const Scope & | descendent | ) | const |
bool Fiea::Engine::Content::Scope::IsDescendentOf | ( | const Scope & | ancestor | ) | const |
bool Fiea::Engine::Content::Scope::operator!= | ( | const Scope & | rhs | ) | const |
Inequality operator.
rhs | The Scope to compare with. |
bool Fiea::Engine::Content::Scope::operator== | ( | const Scope & | rhs | ) | const |
Equality operator.
rhs | The Scope to compare with. |
Datum & Fiea::Engine::Content::Scope::operator[] | ( | size_t | idx | ) |
|
nodiscard |
void Fiea::Engine::Content::Scope::RemoveDatum | ( | const string & | key | ) |
void Fiea::Engine::Content::Scope::SetParent | ( | Scope & | parent | ) |
size_t Fiea::Engine::Content::Scope::Size | ( | ) | const |