![]() |
FYP
1.0.0
Final Year Project -- Alexander Meuer
|
Spawns units in waves. More...
#include <WaveController.hpp>

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::Wave > | mWaveQueue |
| 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. | |
Spawns units in waves.
| WaveController::WaveController | ( | tinyxml2::XMLElement * | xml, |
| std::function< void(std::shared_ptr< Minion >)> const & | spawnUnitCallback | ||
| ) |
Constructs a WaveController.
| xml | A <WaveController> tag, containing one or more <Wave>s. |
| unitPath | Path that spawned units will follow. Units are spawned the the beginning. |
| spawnUnitCallback | Function invoked when a unit is spawned. The unit is passed as the arguement. |