SuperTuxKart
Loading...
Searching...
No Matches
weather.hpp
1//
2// SuperTuxKart - a fun racing game with go-kart
3// Copyright (C) 2011-2015 Joerg Henrichs, Marianne Gagnon
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 3
8// of the License, or (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19#ifndef HEADER_WEATHER_HPP
20#define HEADER_WEATHER_HPP
21
22#include "utils/singleton.hpp"
23#include <vector3d.h>
24
25class SFXBase;
26
27class Weather : public AbstractSingleton<Weather>
28{
29 float m_next_lightning;
30 float m_lightning;
31
32 SFXBase* m_thunder_sound;
33 SFXBase* m_weather_sound;
34
35public:
36 Weather();
37 virtual ~Weather();
38
39 void update(float dt);
40 void playSound();
41
43 void startLightning() { m_lightning = 1.0f; }
44 bool shouldLightning() { return m_lightning > 0.0f; }
45
46 irr::core::vector3df getIntensity();
47};
48
49#endif
Manages the abstract singleton at runtime. This has been designed to allow multi-inheritance....
Definition: singleton.hpp:35
The base class for sound effects.
Definition: sfx_base.hpp:43
Definition: weather.hpp:28
Weather()
The weather manager stores information about the weather.
Definition: weather.cpp:29
void startLightning()
Set the flag that a lightning should be shown.
Definition: weather.hpp:43