25 #ifndef __I6ENGINE_API_COMPONENT_H__
26 #define __I6ENGINE_API_COMPONENT_H__
44 #include "boost/bind.hpp"
45 #include "boost/function.hpp"
46 #include "boost/lexical_cast.hpp"
91 typedef std::tuple<AccessState, std::string, boost::function<std::string(void)>, boost::function<bool(std::string)>, std::string>
componentOptions;
118 return utils::make_shared<T, Component>(id, params);
125 void setOwnerGO(
const WeakGOPtr & objGo);
138 return _objComponentID;
182 virtual void Init() = 0;
203 void enableTicking(
bool allowTicking)
const;
210 virtual std::pair<AddStrategy, int64_t> howToAdd(
const ComPtr & comp)
const;
215 void setSelf(
const WeakComPtr &
self);
220 virtual std::string getTemplateName()
const = 0;
225 virtual std::vector<componentOptions> getComponentOptions() = 0;
306 void doEnableTicking(
bool allowTicking);
utils::sharedPtr< GameObject, GameObject > GOPtr
int64_t _objOwnerID
ID of the GameObject that owns this Component.
std::tuple< AccessState, std::string, boost::function< std::string(void)>, boost::function< bool(std::string)>, std::string > componentOptions
std::vector< ComPtr > getSubComponents() const
returns all SubComponents attached to this Component
static ComPtr createC(const int64_t id, const attributeMap ¶ms)
#define ISIXE_MODULES_API
boost::shared_ptr< Message > Ptr
std::map< std::string, std::string > attributeMap
virtual void Finalize()
finalizes the component
uint32_t getComponentID() const
Returns the component identification string.
utils::weakPtr< GameObject > WeakGOPtr
bool _tickingAllowed
status if this object is allowed to tick or not
uint32_t _objFamilyID
Family ID of the Component.
#define ASSERT_THREAD_SAFETY_HEADER
A shared pointer counting references and adds objects being not referenced any more to an internal li...
utils::weakPtr< Component > WeakComPtr
int64_t _id
id of this component
ComponentOptionsParameter
enum for easy access of the parameters in the std::tuple
uint32_t _objComponentID
Component ID of the Component.
boost::function< ComPtr(const int64_t, const attributeMap &)> createGOCCallback
WeakGOPtr _objOwnerGO
Owning GameObject.
void setSync(bool b)
sets whether this object has to be synchronized or not
WeakComPtr _self
a weak_ptr on the own shared_ptr
std::string _identifier
identifies the subcomponent
utils::sharedPtr< Component, Component > ComPtr
bool _wantsToTick
stores if a Component which isn't allowed to tick want to tick, so it can start ticking when ticking ...
Class representing a GameObject in the i6engine.
bool _isTicking
stores whether this Component is actually ticking
AddStrategy
defines how new components should be handled
virtual void Tick()
Components can have Tick method like normal Subsystems this method is called by the ObjectController ...
std::vector< ComPtr > _subComps
vector containing the other componetns of the same type if this is the dispatcher component ...
uint32_t getFamilyID() const
Returns the family identification string.
std::string getIdentifier() const
Returns the family identification string.
AccessState
defines the access state of the components objects
Component Base Class. All Components must derive from Component.
int64_t getID() const
returns the id of the component