The interface class for all components. More...
#include <AbstractComponent.h>
Inherits AbstractStreamedObject.
Inherited by BaseComponent.
Public Member Functions | |
virtual | ~AbstractComponent () |
Destructor. | |
virtual void | Update (const int nDelta)=0 |
Can be overridden to implement logic that is called on every game update. | |
virtual void | Attach (GameEntity *pEntity)=0 |
Can be overriden to implement logic that is called when the component is created and attached to the game entity. | |
virtual void | Detach ()=0 |
Can be overriden to implement logic that is called when the component is removed from the game entity. | |
virtual bool | FromAttribute (const Attribute *pRoot)=0 |
Can be overriden to implement custom loading functionality from an AttributeTree. | |
virtual const ComponentId & | GetComponentName () const =0 |
Get the name (type) of this component. | |
virtual const ComponentId & | GetFamilyName () const =0 |
Get the family of this component. |
The interface class for all components.
Components shouldn't directly inherity from this but should instead inherity from
virtual void AbstractComponent::Attach | ( | GameEntity * | pEntity | ) | [pure virtual] |
Can be overriden to implement logic that is called when the component is created and attached to the game entity.
pEntity | A pointer to the entity that this component has been created on. |
Implemented in BaseComponent.
virtual bool AbstractComponent::FromAttribute | ( | const Attribute * | pRoot | ) | [pure virtual] |
Can be overriden to implement custom loading functionality from an AttributeTree.
pRoot | A pointer to the root of the attribute tree for this component. |
Implemented in ComplexPhysicalComponent, MultiPhysicsToMultiVisualComponent, PlayerComponent, and VisualComponent.
virtual const ComponentId& AbstractComponent::GetComponentName | ( | ) | const [pure virtual] |
Get the name (type) of this component.
Implemented in BaseComponent.
virtual const ComponentId& AbstractComponent::GetFamilyName | ( | ) | const [pure virtual] |
Get the family of this component.
Families are used in order to provide mutually exclusive types of components. Only one component with a given family name can be present in an entity at any one time. This helps with having specific implementations of components still be referenced to by one umbrella type.
Implemented in BaseComponent.
virtual void AbstractComponent::Update | ( | const int | nDelta | ) | [pure virtual] |
Can be overridden to implement logic that is called on every game update.
nDelta | The time between this frame and last (in ms). |
Implemented in ComplexPhysicalComponent, MultiPhysicsToMultiVisualComponent, PlayerComponent, and VisualComponent.