AbstractComponent Class Reference

The interface class for all components. More...

#include <AbstractComponent.h>

Inherits AbstractStreamedObject.

Inherited by BaseComponent.

Collaboration diagram for AbstractComponent:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

The interface class for all components.

Components shouldn't directly inherity from this but should instead inherity from

See also:
BaseComponent This class provides a basic set of methods that all components should be required to implement in some form or another.

Member Function Documentation

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.

Parameters:
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.

Parameters:
pRoot A pointer to the root of the attribute tree for this component.
Returns:
If false is returned then loading was a failure and the component will not be added to the game entity.

Implemented in ComplexPhysicalComponent, MultiPhysicsToMultiVisualComponent, PlayerComponent, and VisualComponent.

virtual const ComponentId& AbstractComponent::GetComponentName (  )  const [pure virtual]

Get the name (type) of this component.

Returns:
A unique component id that can be used to create the component by passing it into the component factory.

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.

Returns:
The unique component id representing the components family.

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.

Parameters:
nDelta The time between this frame and last (in ms).

Implemented in ComplexPhysicalComponent, MultiPhysicsToMultiVisualComponent, PlayerComponent, and VisualComponent.


The documentation for this class was generated from the following file:
 All Classes Functions Variables

Generated on Fri Nov 20 15:29:20 2009 for PhysTank by  doxygen 1.6.1