CCmp Class Reference

Base component class. More...

#include <cmp.h>

Inheritance diagram for CCmp:

CCmpActivator CCmpAnimate CCmpBrain CCmpCollision CCmpControl CCmpDebug CCmpFader CCmpHead CCmpHealth CCmpHUD CCmpInventory CCmpMoveBasic CCmpMoveLift CCmpObjType CCmpPath CCmpPhys CCmpPhysBiped CCmpSenses CCmpSound CCmpTrigger CCmpWeapon

List of all members.

Cmp Creation methods

Factory methods are the only way to create a CCmp.

static CCmpcreate_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

CGameEntitym_pGE
 Game entity under our control.
eCmp m_eType
 Type of component.


Detailed Description

Base component class.

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.

Author:
Doug Poston
Version:
1.3
Date:
12/28/2007

Constructor & Destructor Documentation

CCmp::CCmp ( CGameEntity pGE,
eCmp  type 
) [inline, protected]

Protected constructor (called from CCmp::create_cmp factory).

Parameters:
pGE Pointer to parent GameEntity.
type Our CMP type.


Member Function Documentation

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.

Parameters:
pGE Pointer to parent GE this new CMP will belong to.
type Type of CMP we want to create.
Returns:
Pointer to the CMP created (NULL on error).

eCmp CCmp::type (  )  const [inline]

Get component type (eCmp).

Returns:
The type of component this is.

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.

Parameters:
editData Data type and value (see EDIT_DATA struct).
Returns:
Value less than zero on error, 0 if nothing found, positive otherwise.
See also:
EDIT_DATA

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.

Parameters:
editData Data type we are looking for, and memory to store value (see EDIT_DATA struct).
Returns:
Value less than zero on error, 0 if nothing found, positive otherwise.
See also:
EDIT_DATA

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).

Parameters:
actData The data used to preform the action (see ACTION_DATA struct).
Returns:
Value less than zero on error, 0 if no action found, positive otherwise.
See also:
ACTION_DATA

Implemented in CCmpActivator, CCmpAnimate, CCmpBrain, CCmpCollision, CCmpControl, CCmpDebug, CCmpFader, CCmpHead, CCmpHealth, CCmpHUD, CCmpInventory, CCmpMoveBasic, CCmpMoveLift, CCmpObjType, CCmpPath, CCmpPhys, CCmpPhysBiped, CCmpSenses, CCmpSound, CCmpTrigger, and CCmpWeapon.


The documentation for this class was generated from the following files:
Generated on Fri Dec 28 12:55:07 2007 for template7 by  doxygen 1.5.4