#include <Library.h>
|
| template<typename T> |
| static auto | get (const std::string &name) -> T * |
| | get a pointer to an object in the library.
|
| static auto | flush () -> void |
| | remove objects from the library, this will break anything that uses its resources
|
|
| static auto | findObject (const std::string &name) -> AnySerializable * |
| | helper function, finds an object in the objects library, if it doesn't exist, it creates it
|
| static auto | addObject (const std::string &name) -> AnySerializable * |
| | adds an object that doesn't exist to the objects library
|
◆ Library() [1/3]
◆ ~Library()
| th::Library::~Library |
( |
| ) |
|
|
default |
◆ Library() [2/3]
| th::Library::Library |
( |
const Library & | other | ) |
|
|
delete |
◆ Library() [3/3]
| th::Library::Library |
( |
Library && | other | ) |
|
|
deletenoexcept |
◆ addObject()
| auto th::Library::addObject |
( |
const std::string & | name | ) |
->AnySerializable * |
|
staticprivate |
adds an object that doesn't exist to the objects library
add an object to the dictionary of objects, and return a pointer to it
- Parameters
-
| name | the name of the object to construct |
- Returns
- a non-owning AnySerializable pointer to the newly constructed object
- Parameters
-
| name | the name of the object to load |
- Returns
- a pointer to an AnySerializable with the object requested.
◆ findObject()
| auto th::Library::findObject |
( |
const std::string & | name | ) |
->AnySerializable * |
|
staticprivate |
helper function, finds an object in the objects library, if it doesn't exist, it creates it
- Parameters
-
| name | the name of the object to find |
- Returns
- a non-owning AnySerializable pointer to the data
◆ flush()
| auto th::Library::flush |
( |
| ) |
->void |
|
static |
remove objects from the library, this will break anything that uses its resources
◆ get() [1/2]
template<>
| auto th::Library::get |
( |
const std::string & | name | ) |
->GameObject * |
|
inline |
a template specialization for get<>() that returns the object to get as a pointer to a gameobject useful when you don't know or don't care about the type you're loading.
be very careful using this, and make sure the thing you are loading is actually a gameobject
- Parameters
-
- Returns
- a gameobject*
◆ get() [2/2]
template<typename T>
| auto th::Library::get |
( |
const std::string & | name | ) |
->T * |
|
inlinestatic |
get a pointer to an object in the library.
if it doesn't exist, it will create it
- Template Parameters
-
| T | the type of the object to create |
- Parameters
-
| name | the name of the object to create. Data/ gets prepended, and .json gets postpended |
- Returns
- a raw (non-owning) pointer to the object owned by library
◆ operator=() [1/2]
| auto th::Library::operator= |
( |
const Library & | other | ) |
->Library &=delete |
|
delete |
◆ operator=() [2/2]
◆ objects
a static unordered map of objects in the library
The documentation for this class was generated from the following files:
- /home/egrazil/sites/Brunot/The House/source/Framework/Library.h
- /home/egrazil/sites/Brunot/The House/source/Framework/Library.cpp