Dragonfly  4.3
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 
11 namespace df {
12 
13 /// Precipitation types.
15  UNDEFINED_PRECIPITATION_TYPE = -1,
16  SNOW,
17  RAIN,
18  STARFIELD,
19 };
20 
21 class 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);
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__
Vector m_velocity_init
Initial velocity.
Definition: Precipitation.h:25
void setTurbulence(bool new_turbulence=true)
Set turbulence of Precipitation.
Definition: Particle.h:41
Direction
Directions.
Definition: Particle.h:33
Definition: Event.h:15
int eventHandler(const Event *p_e)
Handle step events.
A 2-d bounding box.
Definition: Box.h:10
bool m_turbulence
True if turbulence.
Definition: Precipitation.h:26
Direction m_direction
Direction precipitation travelling.
Definition: Precipitation.h:24
PrecipitationType
Precipitation types.
Definition: Precipitation.h:14
Precipitation(float size, Direction direction, unsigned char opacity, unsigned char r, unsigned char g, unsigned char b)
Constructor, specifing size, direction, opacity and rgb.
Definition: Precipitation.h:21
Definition: Vector.h:10