i6engine
1.0
|
Component Base Class. All Components must derive from Component. More...
#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/api/components/Component.h>
Public Member Functions | |
Component () | |
Constructor for Component. More... | |
Component (const int64_t id, const attributeMap ¶ms) | |
Constructor for Component. More... | |
virtual | ~Component () |
Destructor of Component. Must be implemented in derived class. More... | |
void | setOwnerGO (const WeakGOPtr &objGo) |
Sets the GameObject that owns this Component. More... | |
GOPtr | getOwnerGO () |
Get the GameObject that owns this Component. More... | |
uint32_t | getComponentID () const |
Returns the component identification string. More... | |
uint32_t | getFamilyID () const |
Returns the family identification string. More... | |
std::string | getIdentifier () const |
Returns the family identification string. More... | |
virtual void | Tick () |
Components can have Tick method like normal Subsystems this method is called by the ObjectController during every Tick if the component registered itself at the ObjectFacade. More... | |
void | setDie () const |
component will be deleted soon More... | |
int64_t | getID () const |
returns the id of the component More... | |
virtual void | News (const GameMessage::Ptr &msg) |
Receives messages for this component override this function, if you expect messages. More... | |
virtual void | Init ()=0 |
initializes the Component More... | |
virtual void | Finalize () |
finalizes the component More... | |
virtual attributeMap | synchronize () const =0 |
synchronizes the Components state More... | |
void | setSync (bool b) |
sets whether this object has to be synchronized or not More... | |
bool | getSync () const |
void | enableTicking (bool allowTicking) const |
triggers doEnableTicking threadsafe More... | |
virtual std::pair< AddStrategy, int64_t > | howToAdd (const ComPtr &comp) const |
asks, how to handle a new component with the same type More... | |
void | setSelf (const WeakComPtr &self) |
sets weak_ptr on self for registration of ticker More... | |
virtual std::string | getTemplateName () const =0 |
returns the name this template was registered with More... | |
virtual std::vector< componentOptions > | getComponentOptions ()=0 |
returns a vector containing all options of the Component being readable and writeable in the editor More... | |
std::vector< ComPtr > | getSubComponents () const |
returns all SubComponents attached to this Component More... | |
Static Public Member Functions | |
template<typename T > | |
static ComPtr | createC (const int64_t id, const attributeMap ¶ms) |
Protected Member Functions | |
void | addTicker () |
adds this component to ticklist More... | |
void | removeTicker () |
removes this component from ticklist More... | |
void | doEnableTicking (bool allowTicking) |
sets ticking status for this Component per default all Components are allowed to tick and calling addTicker will start ticking, but in some cases, e.g. for level editor, ticking has to be disabled and just a few components are allowed to tick More... | |
Protected Attributes | |
int64_t | _objOwnerID |
ID of the GameObject that owns this Component. More... | |
WeakGOPtr | _objOwnerGO |
Owning GameObject. More... | |
uint32_t | _objComponentID |
Component ID of the Component. More... | |
uint32_t | _objFamilyID |
Family ID of the Component. More... | |
std::vector< ComPtr > | _subComps |
vector containing the other componetns of the same type if this is the dispatcher component More... | |
std::string | _identifier |
identifies the subcomponent More... | |
int64_t | _id |
id of this component More... | |
bool | _sync |
WeakComPtr | _self |
a weak_ptr on the own shared_ptr More... | |
bool | _tickingAllowed |
status if this object is allowed to tick or not More... | |
bool | _wantsToTick |
stores if a Component which isn't allowed to tick want to tick, so it can start ticking when ticking will be allowed More... | |
bool | _isTicking |
stores whether this Component is actually ticking More... | |
Friends | |
class | GameObject |
Component Base Class. All Components must derive from Component.
Definition at line 97 of file Component.h.
i6e::api::Component::Component | ( | ) |
Constructor for Component.
i6e::api::Component::Component | ( | const int64_t | id, |
const attributeMap & | params | ||
) |
Constructor for Component.
|
virtual |
Destructor of Component. Must be implemented in derived class.
|
protected |
adds this component to ticklist
|
inlinestatic |
Definition at line 117 of file Component.h.
|
protected |
sets ticking status for this Component per default all Components are allowed to tick and calling addTicker will start ticking, but in some cases, e.g. for level editor, ticking has to be disabled and just a few components are allowed to tick
void i6e::api::Component::enableTicking | ( | bool | allowTicking | ) | const |
triggers doEnableTicking threadsafe
|
inlinevirtual |
finalizes the component
Reimplemented in i6e::api::LuminousAppearanceComponent, i6e::api::MoverComponent, and i6e::api::MovementComponent.
Definition at line 187 of file Component.h.
|
inline |
Returns the component identification string.
Definition at line 137 of file Component.h.
|
pure virtual |
returns a vector containing all options of the Component being readable and writeable in the editor
Implemented in i6e::api::PhysicalStateComponent, i6e::api::LuminousAppearanceComponent, i6e::api::MeshAppearanceComponent, i6e::api::CameraComponent, i6e::api::MoverInterpolateComponent, i6e::api::MoverComponent, i6e::api::TerrainAppearanceComponent, i6e::api::StaticStateComponent, i6e::api::SpawnpointComponent, i6e::api::MoverCircleComponent, i6e::api::BillboardComponent, i6e::api::SoundComponent, i6e::api::ParticleEmitterComponent, i6e::api::LifetimeComponent, i6e::api::LineComponent, i6e::api::MovableTextComponent, i6e::api::VelocityComponent, i6e::api::AnimatedLuminousAppearanceComponent, i6e::api::AnimatedSpotLightComponent, i6e::api::SoundListenerComponent, i6e::api::Point2PointConstraintComponent, i6e::api::WaypointComponent, i6e::api::FollowComponent, i6e::api::WaynetNavigationComponent, i6e::api::MoveComponent, i6e::api::NetworkSenderComponent, and i6e::api::ToggleWaynetComponent.
|
inline |
Returns the family identification string.
Definition at line 145 of file Component.h.
|
inline |
returns the id of the component
Definition at line 169 of file Component.h.
|
inline |
Returns the family identification string.
Definition at line 153 of file Component.h.
GOPtr i6e::api::Component::getOwnerGO | ( | ) |
Get the GameObject that owns this Component.
|
inline |
returns all SubComponents attached to this Component
Definition at line 230 of file Component.h.
|
inline |
Definition at line 198 of file Component.h.
|
pure virtual |
returns the name this template was registered with
Implemented in i6e::api::PhysicalStateComponent, i6e::api::LuminousAppearanceComponent, i6e::api::MeshAppearanceComponent, i6e::api::CameraComponent, i6e::api::MoverInterpolateComponent, i6e::api::TerrainAppearanceComponent, i6e::api::StaticStateComponent, i6e::api::SpawnpointComponent, i6e::api::BillboardComponent, i6e::api::MoverCircleComponent, i6e::api::SoundComponent, i6e::api::ParticleEmitterComponent, i6e::api::LifetimeComponent, i6e::api::LineComponent, i6e::api::MovableTextComponent, i6e::api::VelocityComponent, i6e::api::AnimatedLuminousAppearanceComponent, i6e::api::AnimatedSpotLightComponent, i6e::api::SoundListenerComponent, i6e::api::AnimationControllerComponent, i6e::api::Point2PointConstraintComponent, i6e::api::AnimatedDirectionalLightComponent, i6e::api::WaypointComponent, i6e::api::FollowComponent, i6e::api::WaynetNavigationComponent, i6e::api::MoveComponent, i6e::api::NetworkSenderComponent, i6e::api::ToggleWaynetComponent, and i6e::api::MovingCameraComponent.
|
virtual |
asks, how to handle a new component with the same type
[in] | comp | component that shall be added |
Reimplemented in i6e::api::CameraComponent, and i6e::api::MoverComponent.
|
pure virtual |
initializes the Component
Implemented in i6e::api::LuminousAppearanceComponent, i6e::api::CameraComponent, i6e::api::MoverComponent, i6e::api::ShatterComponent, i6e::api::MovementComponent, and i6e::api::NetworkSenderComponent.
|
virtual |
Receives messages for this component override this function, if you expect messages.
Reimplemented in i6e::api::MoverComponent, and i6e::api::ShatterComponent.
|
protected |
removes this component from ticklist
void i6e::api::Component::setDie | ( | ) | const |
component will be deleted soon
void i6e::api::Component::setOwnerGO | ( | const WeakGOPtr & | objGo | ) |
Sets the GameObject that owns this Component.
[in] | objGO | type of GameObject* |
void i6e::api::Component::setSelf | ( | const WeakComPtr & | self | ) |
sets weak_ptr on self for registration of ticker
|
inline |
sets whether this object has to be synchronized or not
Definition at line 197 of file Component.h.
|
pure virtual |
synchronizes the Components state
Implemented in i6e::api::PhysicalStateComponent, i6e::api::LuminousAppearanceComponent, i6e::api::MeshAppearanceComponent, i6e::api::CameraComponent, i6e::api::MoverInterpolateComponent, i6e::api::MoverComponent, i6e::api::TerrainAppearanceComponent, i6e::api::StaticStateComponent, i6e::api::SpawnpointComponent, i6e::api::BillboardComponent, i6e::api::MoverCircleComponent, i6e::api::ShatterComponent, i6e::api::SoundComponent, i6e::api::ParticleEmitterComponent, i6e::api::LifetimeComponent, i6e::api::LineComponent, i6e::api::MovableTextComponent, i6e::api::VelocityComponent, i6e::api::AnimatedLuminousAppearanceComponent, i6e::api::AnimatedSpotLightComponent, i6e::api::SoundListenerComponent, i6e::api::AnimationControllerComponent, i6e::api::Point2PointConstraintComponent, i6e::api::AnimatedDirectionalLightComponent, i6e::api::WaypointComponent, i6e::api::FollowComponent, i6e::api::MoveComponent, i6e::api::WaynetNavigationComponent, i6e::api::NetworkSenderComponent, and i6e::api::ToggleWaynetComponent.
|
inlinevirtual |
Components can have Tick method like normal Subsystems this method is called by the ObjectController during every Tick if the component registered itself at the ObjectFacade.
Reimplemented in i6e::api::MoverComponent, i6e::api::AnimatedLuminousAppearanceComponent, and i6e::api::MovementComponent.
Definition at line 159 of file Component.h.
|
friend |
Definition at line 98 of file Component.h.
|
protected |
id of this component
Definition at line 268 of file Component.h.
|
protected |
identifies the subcomponent
Definition at line 263 of file Component.h.
|
protected |
stores whether this Component is actually ticking
Definition at line 290 of file Component.h.
|
protected |
Component ID of the Component.
Definition at line 248 of file Component.h.
|
protected |
Family ID of the Component.
Definition at line 253 of file Component.h.
|
protected |
Owning GameObject.
Definition at line 243 of file Component.h.
|
protected |
ID of the GameObject that owns this Component.
Definition at line 238 of file Component.h.
|
protected |
a weak_ptr on the own shared_ptr
Definition at line 275 of file Component.h.
|
protected |
vector containing the other componetns of the same type if this is the dispatcher component
Definition at line 258 of file Component.h.
|
protected |
Definition at line 270 of file Component.h.
|
protected |
status if this object is allowed to tick or not
Definition at line 280 of file Component.h.
|
protected |
stores if a Component which isn't allowed to tick want to tick, so it can start ticking when ticking will be allowed
Definition at line 285 of file Component.h.