i6engine  1.0
i6e::api::ShatterComponent Class Referenceabstract

This class is needed on every GameObject with: TRIGGER The shatter() method is called for detected collisions. More...

#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/api/components/ShatterComponent.h>

Public Member Functions

 ShatterComponent (int64_t id, const attributeMap &params)
 Constructor of the component with a given id. More...
 
virtual ~ShatterComponent ()
 Destructor of the component. More...
 
virtual void Init () override
 Initializes the Component. More...
 
void resetRespawn ()
 
virtual void shatter (const GOPtr &other)=0
 Is called after a collision is detected. More...
 
virtual void News (const GameMessage::Ptr &msg) override
 Receives messages for this component. More...
 
virtual attributeMap synchronize () const override
 synchronizes the Components state More...
 
- Public Member Functions inherited from i6e::api::Component
 Component ()
 Constructor for Component. More...
 
 Component (const int64_t id, const attributeMap &params)
 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 Finalize ()
 finalizes the component 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< componentOptionsgetComponentOptions ()=0
 returns a vector containing all options of the Component being readable and writeable in the editor More...
 
std::vector< ComPtrgetSubComponents () const
 returns all SubComponents attached to this Component More...
 

Additional Inherited Members

- Static Public Member Functions inherited from i6e::api::Component
template<typename T >
static ComPtr createC (const int64_t id, const attributeMap &params)
 
- Protected Member Functions inherited from i6e::api::Component
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 inherited from i6e::api::Component
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...
 

Detailed Description

This class is needed on every GameObject with: TRIGGER The shatter() method is called for detected collisions.

Definition at line 42 of file ShatterComponent.h.

Constructor & Destructor Documentation

i6e::api::ShatterComponent::ShatterComponent ( int64_t  id,
const attributeMap params 
)

Constructor of the component with a given id.

virtual i6e::api::ShatterComponent::~ShatterComponent ( )
virtual

Destructor of the component.

Member Function Documentation

virtual void i6e::api::ShatterComponent::Init ( )
overridevirtual

Initializes the Component.

Implements i6e::api::Component.

Reimplemented in i6e::api::MoverComponent.

virtual void i6e::api::ShatterComponent::News ( const GameMessage::Ptr msg)
overridevirtual

Receives messages for this component.

Reimplemented from i6e::api::Component.

Reimplemented in i6e::api::MoverComponent.

void i6e::api::ShatterComponent::resetRespawn ( )
inline

Definition at line 59 of file ShatterComponent.h.

virtual void i6e::api::ShatterComponent::shatter ( const GOPtr other)
pure virtual

Is called after a collision is detected.

Parameters
[in]otherGameObject you collided with

Implemented in i6e::api::MoverComponent.

virtual attributeMap i6e::api::ShatterComponent::synchronize ( ) const
overridevirtual

synchronizes the Components state

Implements i6e::api::Component.

Reimplemented in i6e::api::MoverInterpolateComponent, i6e::api::MoverComponent, and i6e::api::MoverCircleComponent.


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