Dragonfly
4.20
A text-based game engine
v4.20
include
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.
14
enum
PrecipitationType
{
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)
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__
df::Event
Definition:
Event.h:15
df::Particle
Definition:
Particle.h:38
df::Precipitation
Definition:
Precipitation.h:21
df::Precipitation::m_turbulence
bool m_turbulence
True if turbulence.
Definition:
Precipitation.h:26
df::Precipitation::m_velocity_init
Vector m_velocity_init
Initial velocity.
Definition:
Precipitation.h:25
df::Precipitation::Precipitation
Precipitation(float size, Direction direction, unsigned char opacity, unsigned char r, unsigned char g, unsigned char b)
Constructor, specifing size, direction, opacity and rgb.
df::Precipitation::setTurbulence
void setTurbulence(bool new_turbulence=true)
Set turbulence of Precipitation.
df::Precipitation::m_direction
Direction m_direction
Direction precipitation travelling.
Definition:
Precipitation.h:24
df::Precipitation::eventHandler
int eventHandler(const Event *p_e) override
Handle step events.
df::Vector
Definition:
Vector.h:12
df
An animation for a sprite.
Definition:
Animation.h:15
df::Direction
Direction
Directions.
Definition:
Particle.h:30
df::PrecipitationType
PrecipitationType
Precipitation types.
Definition:
Precipitation.h:14
Generated by
1.9.4