Component Class Reference

#include <Component.h>

Inheritance diagram for Component:
ListenerObject Behavior Body Collider Mutator VisualComponent Ball Box LineField Sprite Wireframe InverseBox BgmapSprite ObjectSprite ObjectSpriteContainer Asterisk Line Mesh Sphere

# Public Types

enum  ComponentCommands
enum  ComponentTypes

# Public Member Functions

void constructor (Entity owner, const ComponentSpec *componentSpec)
void destructor ()
 Class' destructor.
ComponentSpecgetSpec ()
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 ComponentSpeccomponentSpec
 Pointer to the spec that defines how to initialize the component.
const Transformationtransformation
bool deleteMe
 Flag to mark the component as pending deletion.

# Additional Inherited Members

- Private Member Functions inherited from ListenerObject
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)
- Private Attributes inherited from ListenerObject
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

Component commands

Definition at line 33 of file Component.h.

# 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
ownerEntity to which the component attaches to
componentSpecPointer 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()

RightBox Component::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 ( )

Retrieve the component's type.

Returns
Component's type'

Definition at line 109 of file Component.c.

# handleCommand()

void Component::handleCommand ( int32 command,
va_list args )
virtual

Handle a command.

Parameters
commandCommand to handle
argsVariable arguments list depending on the command to handle

Reimplemented in Body, Collider, and VisualComponent.

Definition at line 121 of file Component.c.

# releaseResources()

void Component::releaseResources ( )
virtual

Called to release the component.

Reimplemented in Sprite.

Definition at line 116 of file Component.c.

# Member Data Documentation

# componentSpec

const ComponentSpec* Component::componentSpec
protected

Pointer to the spec that defines how to initialize the component.

Definition at line 85 of file Component.h.

# deleteMe

bool Component::deleteMe
protected

Flag to mark the component as pending deletion.

Definition at line 92 of file Component.h.

# owner

Entity Component::owner
protected

Object to which this component attaches to.

Definition at line 82 of file Component.h.

# transformation

const Transformation* Component::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: