Peoplemon  0.1.0
Peoplemon 3 game source documentation
Snow.hpp
Go to the documentation of this file.
1 #ifndef CORE_MAPS_WEATHER_SNOW_HPP
2 #define CORE_MAPS_WEATHER_SNOW_HPP
3 
4 #include "Base.hpp"
5 
6 #include "Thunder.hpp"
7 #include <BLIB/Particles.hpp>
8 #include <Core/Resources.hpp>
9 #include <SFML/Graphics.hpp>
10 
11 namespace core
12 {
13 namespace map
14 {
15 namespace weather
16 {
17 namespace snow
18 {
19 struct Snowflake;
20 struct TimeEmitter;
21 } // namespace snow
22 
28 class Snow : public Base {
29 public:
36  Snow(bool hard, bool thunder);
37 
41  virtual ~Snow();
42 
46  virtual Weather::Type type() const override;
47 
55  virtual void start(bl::engine::Engine& engine, bl::rc::RenderTarget& renderTarget,
56  Map& map) override;
57 
61  virtual void stop() override;
62 
66  virtual bool stopped() const override;
67 
73  virtual void update(float dt) override;
74 
75 private:
76  bl::engine::Engine* engine;
77  const Weather::Type _type;
78  const unsigned int targetParticleCount;
79  const float fallSpeed;
80  float stopFactor;
81 
82  bl::pcl::ParticleManager<snow::Snowflake>* particles;
83  snow::TimeEmitter* emitter;
84  Thunder thunder;
85  bl::rc::res::TextureRef snowTxtr;
86 };
87 
88 } // namespace weather
89 } // namespace map
90 } // namespace core
91 
92 #endif
Core classes and functionality for both the editor and game.
core::map::weather::snow::Snowflake Snowflake
Definition: Snow.cpp:72
The primary map class that represents a usable map in the game.
Definition: Map.hpp:49
Type
The type of weather.
Definition: Weather.hpp:38
Base class for all weather types.
Definition: Base.hpp:28
Snow weather system.
Definition: Snow.hpp:28
virtual void stop() override
Stops the snow.
Definition: Snow.cpp:235
virtual Weather::Type type() const override
One of LightSnow, LightSnowThunder, HardSnow, HardSnowThunder.
Definition: Snow.cpp:212
virtual bool stopped() const override
Returns true when no snow is left after a call to stop()
Definition: Snow.cpp:240
Snow(bool hard, bool thunder)
Create snowy weather.
Definition: Snow.cpp:197
virtual void start(bl::engine::Engine &engine, bl::rc::RenderTarget &renderTarget, Map &map) override
Start the snow.
Definition: Snow.cpp:214
virtual void update(float dt) override
Updates all the flakes and spawns more.
Definition: Snow.cpp:242
virtual ~Snow()
Destroy the Snow object.
Definition: Snow.cpp:207
Simple helper class for creating thunder in different weather types.
Definition: Thunder.hpp:19