FYP  1.0.0
Final Year Project -- Alexander Meuer
ProjectileManager Class Reference

Updates a collection of projectiles. Projectiles are stored in unique_ptrs. More...

#include <ProjectileManager.hpp>

Collaboration diagram for ProjectileManager:
Collaboration graph

Public Member Functions

 ProjectileManager (std::shared_ptr< collision::CollisionGroup > projectileCollisionGroup, sf::Texture const &particleTexture)
 Constructs an instance of ProjectileManager. More...
 
void give (std::shared_ptr< Projectile > const &projectilePtr)
 Give a projectile to the manager. More...
 
void update (sf::Time const &elapsedTime)
 Calls update on all managed projectiles.
 
void draw (sf::RenderTarget &w)
 Draws all the managed projectiles.
 
void setUnfiredProjectileHandler (std::function< void(std::shared_ptr< Projectile > const &)> const &handler)
 

Private Attributes

std::list< std::shared_ptr< Projectile > > mProjectiles
 The collection of projectiles to be managed.
 
std::shared_ptr< collision::CollisionGroupmCollisionGroup
 Group that projectiles will be checked against upon impact.
 
thor::ParticleSystem mParticleSystem
 
std::function< void(std::shared_ptr< Projectile > const &)> mUnfiredProjectileHandler
 

Detailed Description

Updates a collection of projectiles. Projectiles are stored in unique_ptrs.

Constructor & Destructor Documentation

ProjectileManager::ProjectileManager ( std::shared_ptr< collision::CollisionGroup projectileCollisionGroup,
sf::Texture const &  particleTexture 
)

Constructs an instance of ProjectileManager.

Parameters
projectileCollisionGroupThe collision group against which projectiles will be checked upon impact.
particleTextureTexture used by particles emiited from FancyProjectiles.

Member Function Documentation

void ProjectileManager::give ( std::shared_ptr< Projectile > const &  projectilePtr)

Give a projectile to the manager.

Parameters
projectilePtrMove referenced unique pointer to a projectile.
Remarks
The manager gains ownership of the projectile.

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