i6engine
1.0
|
Factory in order to create Component. More...
#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/modules/object/ComponentFactory.h>
Public Member Functions | |
ComponentFactory () | |
used to easily create special Components More... | |
~ComponentFactory () | |
Destructor for ComponentsFactory. Clears the map of Create methods. More... | |
void | registerCTemplate (const std::string &GOCType, const api::createGOCCallback &fn) |
register a new Template After a template is registered you can easily create new objects of that type with createGOC() More... | |
api::ComPtr | createGOC (int64_t id, const std::string &GOCType, const api::attributeMap ¶ms, const api::WeakGOPtr &owner) const |
Creates a new Component. More... | |
void | enableTicking (bool allowTicking) |
sets whether newly created Components shall be allowed to tick or not default value is true More... | |
Factory in order to create Component.
Definition at line 60 of file ComponentFactory.h.
i6e::modules::ComponentFactory::ComponentFactory | ( | ) |
used to easily create special Components
It is possible to register different Components at the factory with a string to identify them.
After registering, you can create this kind of Component by just calling the create function with the ID-String
i6e::modules::ComponentFactory::~ComponentFactory | ( | ) |
Destructor for ComponentsFactory. Clears the map of Create methods.
api::ComPtr i6e::modules::ComponentFactory::createGOC | ( | int64_t | id, |
const std::string & | GOCType, | ||
const api::attributeMap & | params, | ||
const api::WeakGOPtr & | owner | ||
) | const |
Creates a new Component.
[in] | GOCType | name of the Component to create. |
[in] | params | a std::map<std::string, std::string> used to parameterize the creation process |
I6_FAILURE | When GOCType is not registered at this factory. |
|
inline |
sets whether newly created Components shall be allowed to tick or not default value is true
Definition at line 99 of file ComponentFactory.h.
void i6e::modules::ComponentFactory::registerCTemplate | ( | const std::string & | GOCType, |
const api::createGOCCallback & | fn | ||
) |
register a new Template After a template is registered you can easily create new objects of that type with createGOC()
[in] | name | the string used to identify this Template. The name must be unique. |
[in] | fn | the createGOCCallback function, which creates the Component |