25 #ifndef __I6ENGINE_MODULES_COMPONENTFACTORY_H__
26 #define __I6ENGINE_MODULES_COMPONENTFACTORY_H__
36 #include "boost/function.hpp"
43 typedef utils::sharedPtr<Component, Component>
ComPtr;
44 typedef utils::weakPtr<GameObject>
WeakGOPtr;
50 typedef boost::function<ComPtr(const int64_t, const attributeMap &)>
createGOCCallback;
100 _tickingAllowed = allowTicking;
104 typedef std::map<std::string, api::createGOCCallback> callbackMap;
111 callbackMap _callbacks;
116 bool _tickingAllowed;
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...
void enableTicking(bool allowTicking)
sets whether newly created Components shall be allowed to tick or not default value is true ...
Factory in order to create Component.
std::map< std::string, std::string > attributeMap
ComponentFactory()
used to easily create special Components
utils::weakPtr< GameObject > WeakGOPtr
~ComponentFactory()
Destructor for ComponentsFactory. Clears the map of Create methods.
#define ASSERT_THREAD_SAFETY_HEADER
A shared pointer counting references and adds objects being not referenced any more to an internal li...
api::ComPtr createGOC(int64_t id, const std::string &GOCType, const api::attributeMap ¶ms, const api::WeakGOPtr &owner) const
Creates a new Component.
boost::function< ComPtr(const int64_t, const attributeMap &)> createGOCCallback
utils::sharedPtr< Component, Component > ComPtr