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

Spawns units in waves. More...

#include <WaveController.hpp>

Collaboration diagram for WaveController:
Collaboration graph

Public Member Functions

 WaveController (tinyxml2::XMLElement *xml, std::function< void(std::shared_ptr< Minion >)> const &spawnUnitCallback)
 Constructs a WaveController. More...
 
void update (sf::Time const &elapsedTime)
 
bool isEmpty () const
 

Private Member Functions

bool isTimeToSpawnWave () const
 
void spawnWave ()
 

Private Attributes

float mTimeSinceWave
 Seconds since the last wave was spawned.
 
std::queue< detail::WavemWaveQueue
 Queue of waves to be spawned.
 
UnitFactory mFactory
 Factory used to create units.
 
std::function< void(std::shared_ptr< Minion > const &)> mSpawnUnitCallback
 Function called when a unit is to be spawned.
 

Detailed Description

Spawns units in waves.

See also
detail::Wave

Constructor & Destructor Documentation

WaveController::WaveController ( tinyxml2::XMLElement *  xml,
std::function< void(std::shared_ptr< Minion >)> const &  spawnUnitCallback 
)

Constructs a WaveController.

Parameters
xmlA <WaveController> tag, containing one or more <Wave>s.
unitPathPath that spawned units will follow. Units are spawned the the beginning.
spawnUnitCallbackFunction invoked when a unit is spawned. The unit is passed as the arguement.

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