Thrive
Public Member Functions | Static Public Member Functions | List of all members
thrive::Component Class Referenceabstract

Base class for components. More...

#include <component.h>

Inheritance diagram for thrive::Component:
thrive::CollisionComponent thrive::CompoundAbsorberComponent thrive::CompoundCloudComponent thrive::CompoundComponent thrive::CompoundEmitterComponent thrive::MembraneComponent thrive::MembraneGenerationComponent thrive::OgreCameraComponent thrive::OgreLightComponent thrive::OgreSceneNodeComponent thrive::OgreViewportComponent thrive::OgreWorkspaceComponent thrive::PowerupComponent thrive::RigidBodyComponent thrive::SkyPlaneComponent thrive::SoundSourceComponent thrive::TextOverlayComponent thrive::TimedCompoundEmitterComponent thrive::TimedLifeComponent

Public Member Functions

virtual ~Component ()=0
 Destructor.
 
bool isVolatile () const
 A volatile component is not serialized during a save. More...
 
virtual void load (const StorageContainer &storage)=0
 Loads the component. More...
 
EntityId owner () const
 The entity this component belongs to. More...
 
void setVolatile (bool isVolatile)
 Sets the volatile flag. More...
 
void setOwner (EntityId owner)
 Sets the component's owner. More...
 
virtual StorageContainer storage () const =0
 Serializes the component. More...
 
virtual ComponentTypeId typeId () const =0
 The component's type id.
 
virtual std::string typeName () const =0
 The component's type name.
 

Static Public Member Functions

static luabind::scope luaBindings ()
 Lua bindings. More...
 

Detailed Description

Base class for components.

Components are mainly data classes that "tag" entities with certain properties.

Good introductions to entity / component models:

Member Function Documentation

bool Component::isVolatile ( ) const

A volatile component is not serialized during a save.

Returns
void Component::load ( const StorageContainer &  storage)
pure virtual
luabind::scope Component::luaBindings ( )
static

Lua bindings.

Wrapper class to enable subclassing Component in Lua.

Exposes:

Returns
EntityId thrive::Component::owner ( ) const
inline

The entity this component belongs to.

Returns
The entity this component belongs to or NULL_ENTITY if this component has not been added to an entity yet
void thrive::Component::setOwner ( EntityId  owner)
inline

Sets the component's owner.

Used by the EntityManager

Parameters
owner
void Component::setVolatile ( bool  isVolatile)

Sets the volatile flag.

Parameters
isVolatile
See also
Component::isVolatile
StorageContainer Component::storage ( ) const
pure virtual

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