Dragonfly 4.20
A text-based game engine
Precipitation.h
1///
2/// A precipitation particle
3///
4
5#ifndef __PRECIPITATION_H__
6#define __PRECIPITATION_H__
7
8// Engine include.
9#include "Particle.h"
10
11namespace df {
12
13/// Precipitation types.
15 UNDEFINED_PRECIPITATION_TYPE = -1,
16 SNOW,
17 RAIN,
18 STARFIELD,
19};
20
21class Precipitation : public Particle {
22
23 private:
24 Direction m_direction; ///< Direction precipitation travelling.
25 Vector m_velocity_init; ///< Initial velocity.
26 bool m_turbulence; ///< True if turbulence.
27
28 public:
29
30 /// Constructor, specifing size, direction, opacity and rgb.
31 Precipitation(float size, Direction direction, unsigned char opacity,
32 unsigned char r, unsigned char g, unsigned char b);
33
34 /// Handle step events.
35 /// Return 0 if ignored, else 1.
36 int eventHandler(const Event *p_e) override;
37
38 /// Set turbulence of Precipitation.
39 void setTurbulence(bool new_turbulence = true);
40};
41
42} // end of namespace df
43
44#endif //__PRECIPITATION_H__
Definition: Event.h:15
Definition: Particle.h:38
Definition: Precipitation.h:21
bool m_turbulence
True if turbulence.
Definition: Precipitation.h:26
Vector m_velocity_init
Initial velocity.
Definition: Precipitation.h:25
Precipitation(float size, Direction direction, unsigned char opacity, unsigned char r, unsigned char g, unsigned char b)
Constructor, specifing size, direction, opacity and rgb.
void setTurbulence(bool new_turbulence=true)
Set turbulence of Precipitation.
Direction m_direction
Direction precipitation travelling.
Definition: Precipitation.h:24
int eventHandler(const Event *p_e) override
Handle step events.
Definition: Vector.h:12
An animation for a sprite.
Definition: Animation.h:15
Direction
Directions.
Definition: Particle.h:30
PrecipitationType
Precipitation types.
Definition: Precipitation.h:14