CEffect Class Reference

#include <structs.h>

Collaboration diagram for CEffect:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class represents a visual special effect, which will be rendered to the screen after all other objects have been rendered. Examples of effects could be smoke, fire, dust, etc. This class is implemented as a 'flyweight' design pattern, in that it is used primarily for maintaining a linked list, with each CEffect object pointing to a class that implements a particular effect.

Definition at line 69 of file structs.h.

Public Member Functions

 ~CEffect (void)
 destructor
 CEffect (int type)
 general constructor
void Draw (void)
 draw the effect on screen
bool Step (float timeDelta)
 updates an effect's state

Public Attributes

int iType
 which type this effect will be initialized to (particle system, etc.)
bool bExpired
 flag indicating whether or not this effect is complete
PSystemPSys
 pointers to this effects real data type (flyweight pattern) =)
ShockwaveSWave
TileAnimTAnim
TileStormTStorm
MiniShockMShock
CEffectPrevious
 a link to the previous CEffect when this object is in a linked list
CEffectNext
 a link to the next CEffect when this object is in a linked list


Constructor & Destructor Documentation

CEffect::~CEffect ( void   ) 

Remove the effect and any associated data.

Definition at line 44 of file structs.cpp.

References PSys, and SWave.

CEffect::CEffect ( int  type  ) 

Initializes an effect object based on the effect ID type passed as a parameter.

Definition at line 56 of file structs.cpp.

References bExpired, EFFECTID_MINISHOCK, EFFECTID_NULL, EFFECTID_PSYSTEM, EFFECTID_SHOCKWAVE, EFFECTID_TILEANIM, EFFECTID_TILESTORM, iType, MShock, Next, Previous, PSys, SWave, TAnim, and TStorm.


Member Function Documentation

void CEffect::Draw ( void   ) 

Draws the effect on screen, based on it's effect ID type and it's current instance data.

Definition at line 104 of file structs.cpp.

References MiniShock::Draw(), TileAnim::Draw(), TileStorm::Draw(), Shockwave::Draw(), PSystem::Draw(), EFFECTID_MINISHOCK, EFFECTID_NULL, EFFECTID_PSYSTEM, EFFECTID_SHOCKWAVE, EFFECTID_TILEANIM, EFFECTID_TILESTORM, iType, MShock, PSys, SWave, TAnim, and TStorm.

Referenced by CWorld::DrawEffects().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CEffect::Step ( float  timeDelta  ) 

Updates an effect's state, based on a time delta value passed as a parameter to the function.

Definition at line 141 of file structs.cpp.

References EFFECTID_MINISHOCK, EFFECTID_NULL, EFFECTID_PSYSTEM, EFFECTID_SHOCKWAVE, EFFECTID_TILEANIM, EFFECTID_TILESTORM, iType, MShock, PSys, MiniShock::Step(), TileAnim::Step(), TileStorm::Step(), Shockwave::Step(), PSystem::Step(), SWave, TAnim, and TStorm.

Referenced by CWorld::UpdateEffects().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int CEffect::iType

Definition at line 72 of file structs.h.

Referenced by CEffect(), Draw(), and Step().

bool CEffect::bExpired

Definition at line 74 of file structs.h.

Referenced by CEffect(), CWorld::DrawEffects(), and CWorld::UpdateEffects().

PSystem* CEffect::PSys

Definition at line 76 of file structs.h.

Referenced by CEffect(), Draw(), GameLogicFire(), ProcessTileCollisions(), RemoveDeadObjects(), Step(), and ~CEffect().

Shockwave* CEffect::SWave

Definition at line 77 of file structs.h.

Referenced by CEffect(), Draw(), RemoveDeadObjects(), Step(), and ~CEffect().

TileAnim* CEffect::TAnim

Definition at line 78 of file structs.h.

Referenced by CEffect(), Draw(), PlayGame(), RemoveDeadObjects(), and Step().

TileStorm* CEffect::TStorm

Definition at line 79 of file structs.h.

Referenced by CEffect(), Draw(), RemoveDeadObjects(), and Step().

MiniShock* CEffect::MShock

Definition at line 80 of file structs.h.

Referenced by CEffect(), Draw(), PhysicsReflect(), RemoveDeadObjects(), and Step().

CEffect* CEffect::Previous

Definition at line 82 of file structs.h.

Referenced by CWorld::AddEffect(), CEffect(), and CWorld::RemoveEffect().

CEffect* CEffect::Next

Definition at line 83 of file structs.h.

Referenced by CWorld::AddEffect(), CEffect(), CWorld::DrawEffects(), CWorld::RemoveEffect(), and CWorld::UpdateEffects().

 

Copyright Windsor Schmidt 2006 - All rights reserved.