Arcade Shooter
Public Member Functions | List of all members
ShooterLibrary::ProjectilePool Class Reference

Used to recycle projectiles. More...

#include <ProjectilePool.h>

Public Member Functions

 ProjectilePool (Level *pLevel, bool expands=true)
 Instantiate a projectile pool object. More...
 
virtual void Draw (SpriteBatch *pSpriteBatch)
 Renders all of the projectiles in the pool. More...
 
void Add (Projectile *pProjectile)
 Add a projectile to the pool. More...
 
template<typename T >
ProjectileGetInactiveProjectile ()
 Get the next available projectile. More...
 

Detailed Description

Used to recycle projectiles.

Constructor & Destructor Documentation

◆ ProjectilePool()

ShooterLibrary::ProjectilePool::ProjectilePool ( Level pLevel,
bool  expands = true 
)
inline

Instantiate a projectile pool object.

Parameters
pLevelA pointer to the current level.
expandsAllows the pool to dynamically create projectiles when it's empty.

Member Function Documentation

◆ Add()

void ShooterLibrary::ProjectilePool::Add ( Projectile pProjectile)

Add a projectile to the pool.

Parameters
pProjectileThe projectile to add.

◆ Draw()

void ShooterLibrary::ProjectilePool::Draw ( SpriteBatch pSpriteBatch)
virtual

Renders all of the projectiles in the pool.

Parameters
pSpriteBatchThe game's sprite batch, used for rendering.
Remarks
This is used for manual drawing and is not called by the level.
See also
Projectile::SetManualDraw()
Projectile::IsDrawnByLevel()

◆ GetInactiveProjectile()

template<typename T >
Projectile* ShooterLibrary::ProjectilePool::GetInactiveProjectile ( )
inline

Get the next available projectile.

Returns
Returns a pointer to the projectile.

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