Arcade Shooter
Public Member Functions | Protected Member Functions | Friends | List of all members
KatanaEngine::ParticleTemplate Class Referenceabstract

Base class for particle templates which are used to control the updating of a corresponding particle type. More...

#include <ParticleTemplate.h>

Public Member Functions

 ParticleTemplate (const bool poolExpands=true)
 Instantiates a new particle template object. More...
 
virtual ParticleGetInactiveParticle ()=0
 Get the next available particle. More...
 
virtual void SetTexture (Texture *pTexture)
 Sets the texture. More...
 

Protected Member Functions

virtual TextureGetTexture ()
 Gets the texture to render. More...
 
virtual void SetParticleLifespan (const float seconds)
 Sets the lifespan of the particle in seconds. More...
 
virtual void InitializeParticle (Particle *pParticle)
 Initializes a particle. More...
 
virtual void UpdateParticle (Particle *pParticle, const GameTime *pGameTime)
 Updates a particle. More...
 
template<typename T >
TGetInactiveParticleOfType ()
 Gets a particle of a specific type. More...
 
template<typename T >
TGenerateParticles (const int count=1)
 Generates particles of a specific type. More...
 

Friends

void Particle::Update (const GameTime *pGameTime)
 
void Particle::Draw (SpriteBatch *pSpriteBatch)
 
void Emitter::Update (const GameTime *pGameTime)
 

Detailed Description

Base class for particle templates which are used to control the updating of a corresponding particle type.

Constructor & Destructor Documentation

◆ ParticleTemplate()

ParticleTemplate::ParticleTemplate ( const bool  poolExpands = true)

Instantiates a new particle template object.

Parameters
poolExpandsAllows the pool to dynamically create particles when it's empty.

Member Function Documentation

◆ GenerateParticles()

template<typename T >
T* KatanaEngine::ParticleTemplate::GenerateParticles ( const int  count = 1)
inlineprotected

Generates particles of a specific type.

Returns
Returns a pointer to an inactive particle matching the template type.

◆ GetInactiveParticle()

virtual Particle* KatanaEngine::ParticleTemplate::GetInactiveParticle ( )
pure virtual

Get the next available particle.

Returns
Returns a pointer to the particle.

◆ GetInactiveParticleOfType()

template<typename T >
T* KatanaEngine::ParticleTemplate::GetInactiveParticleOfType ( )
inlineprotected

Gets a particle of a specific type.

Returns
Returns a pointer to an inactive particle matching the template type.

◆ GetTexture()

virtual Texture* KatanaEngine::ParticleTemplate::GetTexture ( )
inlineprotectedvirtual

Gets the texture to render.

Returns
Returns a ponter to the texture.

◆ InitializeParticle()

void ParticleTemplate::InitializeParticle ( Particle pParticle)
protectedvirtual

Initializes a particle.

Parameters
pParticleThe particle to initialize.

◆ SetParticleLifespan()

virtual void KatanaEngine::ParticleTemplate::SetParticleLifespan ( const float  seconds)
inlineprotectedvirtual

Sets the lifespan of the particle in seconds.

Parameters
secondsThe time in seconds that the particle will live.

◆ SetTexture()

virtual void KatanaEngine::ParticleTemplate::SetTexture ( Texture pTexture)
inlinevirtual

Sets the texture.

Parameters
pTextureThe texture to use.

◆ UpdateParticle()

virtual void KatanaEngine::ParticleTemplate::UpdateParticle ( Particle pParticle,
const GameTime pGameTime 
)
inlineprotectedvirtual

Updates a particle.

Parameters
pParticleThe particle to update.
pGameTimeTiming values including time since last update.

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