Component Class Reference
#include <Component.h>
![](../class_component.png)
# Public Types | |
enum | ComponentCommands |
enum | ComponentTypes |
# Public Member Functions | |
void | constructor (Entity owner, const ComponentSpec *componentSpec) |
void | destructor () |
Class' destructor. | |
ComponentSpec * | getSpec () |
Entity | getOwner () |
Retrieve the collider's owner. | |
uint32 | getType () |
virtual void | releaseResources () |
Called to release the component. | |
virtual void | handleCommand (int32 command, va_list args) |
virtual RightBox | getRightBox () |
# Protected Attributes | |
Entity | owner |
Object to which this component attaches to. | |
const ComponentSpec * | componentSpec |
Pointer to the spec that defines how to initialize the component. | |
const Transformation * | transformation |
bool | deleteMe |
Flag to mark the component as pending deletion. |
# Additional Inherited Members | |
![]() | |
void | constructor () |
Class' constructor. | |
void | destructor () |
Class' destructor. | |
void | addEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListener (ListenerObject listener, uint16 eventCode) |
void | removeEventListeners (uint16 eventCode) |
void | removeAllEventListeners () |
Remove all listener objects. | |
bool | hasActiveEventListeners () |
void | fireEvent (uint16 eventCode) |
void | sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay) |
void | sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay) |
void | discardAllMessages () |
Discard all messages, both to be sent and to be received. | |
void | discardMessages (uint32 message) |
virtual bool | onEvent (ListenerObject eventFirer, uint16 eventCode) |
virtual bool | handleMessage (Telegram telegram) |
![]() | |
VirtualList | events |
List of registered events. | |
int8 | eventFirings |
Counter that keeps track of the number of fired events to prevent race conditions in nested firings. |
# Detailed Description
Class Component
Inherits from ListenerObject
Serves as the base class for components of actors.
Definition at line 77 of file Component.h.
# Member Enumeration Documentation
# ComponentCommands
enum ComponentCommands |
Component commands
Definition at line 33 of file Component.h.
# ComponentTypes
enum ComponentTypes |
Component types
Definition at line 43 of file Component.h.
# Member Function Documentation
# constructor()
void Component::constructor | ( | Entity | owner, |
const ComponentSpec * | componentSpec ) |
Class' constructor
- Parameters
-
owner Entity to which the component attaches to componentSpec Pointer to the spec that defines how to initialize the component
Definition at line 42 of file Component.c.
# destructor()
void Component::destructor | ( | ) |
Class' destructor.
Definition at line 80 of file Component.c.
# getOwner()
Entity Component::getOwner | ( | ) |
Retrieve the collider's owner.
Definition at line 102 of file Component.c.
# getRightBox()
|
virtual |
Retrieve the mesh's bounding box.
- Returns
- Bounding box of the mesh
Reimplemented in Mesh, and Sprite.
Definition at line 126 of file Component.c.
# getSpec()
ComponentSpec * Component::getSpec | ( | ) |
Retrieve the spec pointer that defined how to initialized the component
- Returns
- Component spec pointer
Definition at line 95 of file Component.c.
# getType()
uint32 Component::getType | ( | ) |
# handleCommand()
|
virtual |
Handle a command.
- Parameters
-
command Command to handle args Variable arguments list depending on the command to handle
Reimplemented in Body, Collider, and VisualComponent.
Definition at line 121 of file Component.c.
# releaseResources()
|
virtual |
Called to release the component.
Reimplemented in Sprite.
Definition at line 116 of file Component.c.
# Member Data Documentation
# componentSpec
|
protected |
Pointer to the spec that defines how to initialize the component.
Definition at line 85 of file Component.h.
# deleteMe
|
protected |
Flag to mark the component as pending deletion.
Definition at line 92 of file Component.h.
# owner
|
protected |
Object to which this component attaches to.
Definition at line 82 of file Component.h.
# transformation
|
protected |
Cache the transformation of the Entity that the component attaches to to avoid having to retrieve it all the time
Definition at line 89 of file Component.h.
The documentation for this class was generated from the following files:
- VUEngine-Core/source/Component/Component.h
- VUEngine-Core/source/Component/Component.c