TrinityCore
Weather.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
21
22#ifndef __WEATHER_H
23#define __WEATHER_H
24
25#include "Common.h"
26#include "SharedDefines.h"
27#include "Timer.h"
28
29class Player;
30
31#define WEATHER_SEASONS 4
33{
37};
38
40{
43};
44
46{
48 WEATHER_STATE_FOG = 1, // Used in some instance encounters.
62};
63
66{
67 public:
68
69 Weather(uint32 zoneId, WeatherData const* weatherChances);
70 ~Weather() { };
71
72 bool Update(uint32 diff);
73 bool ReGenerate();
74 bool UpdateWeather();
75
76 void SendWeatherUpdateToPlayer(Player* player);
77 static void SendFineWeatherUpdateToPlayer(Player* player);
78 void SetWeather(WeatherType type, float intensity);
79
80 WeatherState GetWeatherState() const;
82 uint32 GetZone() const { return m_zone; };
83 uint32 GetScriptId() const { return m_weatherChances->ScriptId; }
84
85 private:
91};
92#endif
#define TC_GAME_API
Definition: Define.h:123
uint32_t uint32
Definition: Define.h:142
WeatherType
Weather for one zone.
Definition: Weather.h:66
uint32 GetScriptId() const
Definition: Weather.h:83
WeatherType m_type
Definition: Weather.h:87
uint32 m_zone
Definition: Weather.h:86
float m_intensity
Definition: Weather.h:88
WeatherState
Definition: Weather.h:46
WeatherSeasonChances data[WEATHER_SEASONS]
Definition: Weather.h:41
uint32 GetZone() const
For which zone is this weather?
Definition: Weather.h:82
#define WEATHER_SEASONS
Definition: Weather.h:31
~Weather()
Definition: Weather.h:70
uint32 ScriptId
Definition: Weather.h:42
uint32 stormChance
Definition: Weather.h:36
IntervalTimer m_timer
Definition: Weather.h:89
WeatherData const * m_weatherChances
Definition: Weather.h:90
@ WEATHER_STATE_THUNDERS
Definition: Weather.h:59
@ WEATHER_STATE_HEAVY_RAIN
Definition: Weather.h:52
@ WEATHER_STATE_HEAVY_SANDSTORM
Definition: Weather.h:58
@ WEATHER_STATE_MEDIUM_SNOW
Definition: Weather.h:54
@ WEATHER_STATE_MEDIUM_RAIN
Definition: Weather.h:51
@ WEATHER_STATE_MEDIUM_SANDSTORM
Definition: Weather.h:57
@ WEATHER_STATE_BLACKSNOW
Definition: Weather.h:61
@ WEATHER_STATE_FINE
Definition: Weather.h:47
@ WEATHER_STATE_DRIZZLE
Definition: Weather.h:49
@ WEATHER_STATE_LIGHT_SNOW
Definition: Weather.h:53
@ WEATHER_STATE_BLACKRAIN
Definition: Weather.h:60
@ WEATHER_STATE_HEAVY_SNOW
Definition: Weather.h:55
@ WEATHER_STATE_LIGHT_SANDSTORM
Definition: Weather.h:56
@ WEATHER_STATE_FOG
Definition: Weather.h:48
@ WEATHER_STATE_LIGHT_RAIN
Definition: Weather.h:50
void Update(VignetteData &vignette, WorldObject const *owner)
Definition: Vignette.cpp:90