#include <Factory.h>
|
| template<typename T> |
| static auto | make (const std::string &name) -> std::unique_ptr< T > |
| | create an object and heap allocate it.
|
|
| static auto | create (const std::string &name) -> std::unique_ptr< AnySerializable > |
| | create an object and heap allocate it.
|
| static auto | makePath (const std::string &name) -> std::string |
| | prepends "Data/" and appends ".json" to a string maybe in the future we will allow this to handle subfolders for datatypes
|
◆ Factory() [1/3]
◆ ~Factory()
| th::Factory::~Factory |
( |
| ) |
|
|
delete |
◆ Factory() [2/3]
| th::Factory::Factory |
( |
const Factory & | other | ) |
|
|
delete |
◆ Factory() [3/3]
| th::Factory::Factory |
( |
Factory && | other | ) |
|
|
deletenoexcept |
◆ create()
| auto th::Factory::create |
( |
const std::string & | name | ) |
->std::unique_ptr< AnySerializable > |
|
staticprivate |
create an object and heap allocate it.
Does not check if it exists in library
- Parameters
-
| name | the name of the object to create |
- Returns
- a unique pointer to the object to create
◆ make() [1/2]
template<>
| auto th::Factory::make |
( |
const std::string & | name | ) |
->std::unique_ptr< GameObject > |
|
inline |
full specialization of Factory::make() where you request a gameobject, so you don't need to know what type it actually is
- Parameters
-
- Returns
◆ make() [2/2]
template<typename T>
| auto th::Factory::make |
( |
const std::string & | name | ) |
->std::unique_ptr< T > |
|
inlinestatic |
create an object and heap allocate it.
checks if it exists in library, and if it does, copies that instead of constructing a new object
- Template Parameters
-
| T | the type to turn the object into, just a normal anycast |
- Parameters
-
| name | the name of the object to create |
- Returns
- a unique pointer to the object to create
◆ makePath()
| auto th::Factory::makePath |
( |
const std::string & | name | ) |
->std::string |
|
staticprivate |
prepends "Data/" and appends ".json" to a string maybe in the future we will allow this to handle subfolders for datatypes
- Parameters
-
| name | the name of the object to load |
- Returns
- the path to the json of the object
◆ operator=() [1/2]
| auto th::Factory::operator= |
( |
const Factory & | other | ) |
->Factory &=delete |
|
delete |
◆ operator=() [2/2]
◆ Library
| friend th::Factory::Library |
|
private |
The documentation for this class was generated from the following files:
- /home/egrazil/sites/Brunot/The House/source/Framework/Factory.h
- /home/egrazil/sites/Brunot/The House/source/Framework/Factory.cpp