i6engine  1.0
i6e::modules::GOFactory Class Reference

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...
 

Detailed Description

Factory in order to create GameObjects.

See also
api::GameObject

Definition at line 52 of file GOFactory.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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.

Parameters
[in]namethe string used to identify a template.
[in]paramsa list of pair<std::string, std::string> used to parameterize the creation process
[in]sendertrue if this GameObject should be synchronized in multiplayer games
Returns
pointer to a new created GameObject or NULL if no template with that name is registered.
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

Parameters
[in]filefile to open
[in]flags
[in]callbackis called for loading progress
Exceptions
I6_FAILUREWhen 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()

See also
createGO()
Parameters
[in]filethe template file containing object data

The documentation for this class was generated from the following file: