i6engine
1.0
|
Factory in order to create GameObjects. More...
#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/modules/object/GOFactory.h>
Public Member Functions | |
GOFactory (ObjectManager *m, ComponentFactory *c) | |
used to easily create special GameObjects More... | |
void | registerGOTemplate (const std::string &file) |
register a new Template After a template is registered you can easily create new objects of that type with createGO() More... | |
GOPtr | createGO (const int64_t goid, const core::IPKey &owner, uint64_t uuid, const std::string &tpl, const api::objects::GOTemplate &templ, const bool sender) |
creates a new GameObject of that type More... | |
GOPtr | createGO (const std::string &tmpl, int64_t goid, const core::IPKey &owner, uint64_t uuid, const api::objects::GOTemplate &templ, const bool sender) |
void | loadLevel (const std::string &file, const std::string &flags, const std::function< void(uint16_t)> &callback) |
loads a level out of the given file with the given flags More... | |
Factory in order to create GameObjects.
Definition at line 52 of file GOFactory.h.
i6e::modules::GOFactory::GOFactory | ( | ObjectManager * | m, |
ComponentFactory * | c | ||
) |
used to easily create special GameObjects
It is possible to register different GameObject at the factory with a string to identify them.
After registering, you can create this kind of GameObjects by just calling the create function with the ID-String
GOPtr i6e::modules::GOFactory::createGO | ( | const int64_t | goid, |
const core::IPKey & | owner, | ||
uint64_t | uuid, | ||
const std::string & | tpl, | ||
const api::objects::GOTemplate & | templ, | ||
const bool | sender | ||
) |
creates a new GameObject of that type
Calls the appropriate create-function and returns the new GameObject.
[in] | name | the string used to identify a template. |
[in] | params | a list of pair<std::string, std::string> used to parameterize the creation process |
[in] | sender | true if this GameObject should be synchronized in multiplayer games |
GOPtr i6e::modules::GOFactory::createGO | ( | const std::string & | tmpl, |
int64_t | goid, | ||
const core::IPKey & | owner, | ||
uint64_t | uuid, | ||
const api::objects::GOTemplate & | templ, | ||
const bool | sender | ||
) |
void i6e::modules::GOFactory::loadLevel | ( | const std::string & | file, |
const std::string & | flags, | ||
const std::function< void(uint16_t)> & | callback | ||
) |
loads a level out of the given file with the given flags
[in] | file | file to open |
[in] | flags | |
[in] | callback | is called for loading progress |
I6_FAILURE | When file can't be opened |
void i6e::modules::GOFactory::registerGOTemplate | ( | const std::string & | file | ) |
register a new Template After a template is registered you can easily create new objects of that type with createGO()
[in] | file | the template file containing object data |