#include <cmp.h>
Cmp Creation methods | |
Factory methods are the only way to create a CCmp. | |
static CCmp * | create_cmp (CGameEntity *pGE, eCmp type) |
Factory used to creates a CMP. | |
CCmp (CGameEntity *pGE, eCmp type) | |
Protected constructor (called from CCmp::create_cmp factory). | |
Public Member Functions | |
eCmp | type () const |
Get component type (eCmp). | |
Virtual methods | |
These will be overridden by derived CMPs (Health, Move, Sound, etc). | |
virtual int | set (const EDIT_DATA &editData)=0 |
Set a value. | |
virtual int | get (EDIT_DATA &editData) const =0 |
Get a value. | |
virtual int | act (const ACTION_DATA &actData)=0 |
Preform an action. | |
virtual void | update ()=0 |
Update this Cmp for a single frame. | |
Protected Attributes | |
CGameEntity * | m_pGE |
Game entity under our control. | |
eCmp | m_eType |
Type of component. |
Componets add functionality to GEs.
(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.
CCmp::CCmp | ( | CGameEntity * | pGE, | |
eCmp | type | |||
) | [inline, protected] |
Protected constructor (called from CCmp::create_cmp factory).
pGE | Pointer to parent GameEntity. | |
type | Our CMP type. |
CCmp * CCmp::create_cmp | ( | CGameEntity * | pGE, | |
eCmp | type | |||
) | [static] |
Factory used to creates a CMP.
Factory functions are the only valid way to create a CMP.
pGE | Pointer to parent GE this new CMP will belong to. | |
type | Type of CMP we want to create. |
eCmp CCmp::type | ( | ) | const [inline] |
Get component type (eCmp).
virtual int CCmp::set | ( | const EDIT_DATA & | editData | ) | [pure virtual] |
Set a value.
If we have data of this type, use editData to set its value.
editData | Data type and value (see EDIT_DATA struct). |
Implemented in CCmpActivator, CCmpAnimate, CCmpBrain, CCmpCollision, CCmpControl, CCmpDebug, CCmpFader, CCmpHead, CCmpHealth, CCmpHUD, CCmpInventory, CCmpMoveBasic, CCmpMoveLift, CCmpObjType, CCmpPath, CCmpPhys, CCmpPhysBiped, CCmpSenses, CCmpSound, CCmpTrigger, and CCmpWeapon.
virtual int CCmp::get | ( | EDIT_DATA & | editData | ) | const [pure virtual] |
Get a value.
If we have data of this type, use editData to get its value.
editData | Data type we are looking for, and memory to store value (see EDIT_DATA struct). |
Implemented in CCmpActivator, CCmpAnimate, CCmpBrain, CCmpCollision, CCmpControl, CCmpDebug, CCmpFader, CCmpHead, CCmpHealth, CCmpHUD, CCmpInventory, CCmpMoveBasic, CCmpMoveLift, CCmpObjType, CCmpPath, CCmpPhys, CCmpPhysBiped, CCmpSenses, CCmpSound, CCmpTrigger, and CCmpWeapon.
virtual int CCmp::act | ( | const ACTION_DATA & | actData | ) | [pure virtual] |
Preform an action.
Handle the action passed in (ignore if we do not handle the action type).
actData | The data used to preform the action (see ACTION_DATA struct). |
Implemented in CCmpActivator, CCmpAnimate, CCmpBrain, CCmpCollision, CCmpControl, CCmpDebug, CCmpFader, CCmpHead, CCmpHealth, CCmpHUD, CCmpInventory, CCmpMoveBasic, CCmpMoveLift, CCmpObjType, CCmpPath, CCmpPhys, CCmpPhysBiped, CCmpSenses, CCmpSound, CCmpTrigger, and CCmpWeapon.