Peoplemon  0.1.0
Peoplemon 3 game source documentation
Thunder.hpp
Go to the documentation of this file.
1 #ifndef CORE_MAPS_WEATHER_THUNDER_HPP
2 #define CORE_MAPS_WEATHER_THUNDER_HPP
3 
4 #include <BLIB/Audio.hpp>
5 #include <BLIB/Resources.hpp>
6 #include <SFML/Graphics.hpp>
7 
8 namespace core
9 {
10 namespace map
11 {
12 namespace weather
13 {
19 class Thunder {
20 public:
27  Thunder(bool enabled, bool frequent);
28 
32  ~Thunder();
33 
37  void stop();
38 
44  void update(float dt);
45 
46 private:
47  const bool enabled;
48  const float minInterval;
49  const float maxInterval;
50  float timeSinceLastThunder;
51  bl::audio::AudioSystem::Handle sound;
52  bool stopping;
53 };
54 
55 } // namespace weather
56 } // namespace map
57 } // namespace core
58 
59 #endif
Core classes and functionality for both the editor and game.
Simple helper class for creating thunder in different weather types.
Definition: Thunder.hpp:19
void stop()
Prevents further thunder and fades out current strike if present.
Definition: Thunder.cpp:42
void update(float dt)
Update the thunder.
Definition: Thunder.cpp:44
~Thunder()
Stops the thunder sound.
Definition: Thunder.cpp:40
Thunder(bool enabled, bool frequent)
Construct a new Thunder object.
Definition: Thunder.cpp:29