TrinityCore
Loading...
Searching...
No Matches
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 Map;
30class Player;
31
32#define WEATHER_SEASONS 4
39
45
64
67{
68 public:
69
70 Weather(Map* map, uint32 zoneId, WeatherData const* weatherChances);
71 ~Weather() { };
72
73 bool Update(uint32 diff);
74 bool ReGenerate();
75 bool UpdateWeather();
76
77 void SendWeatherUpdateToPlayer(Player* player);
78 static void SendFineWeatherUpdateToPlayer(Player* player);
79 void SetWeather(WeatherType type, float intensity);
80
82 uint32 GetZone() const { return m_zone; };
83 uint32 GetScriptId() const { return m_weatherChances->ScriptId; }
84
85 private:
86
87 WeatherState GetWeatherState() const;
94};
95#endif
#define TC_GAME_API
Definition Define.h:114
uint32_t uint32
Definition Define.h:133
WeatherType
Definition Map.h:281
Weather for one zone.
Definition Weather.h:67
uint32 GetScriptId() const
Definition Weather.h:83
WeatherType m_type
Definition Weather.h:90
uint32 m_zone
Definition Weather.h:89
float m_intensity
Definition Weather.h:91
WeatherState
Definition Weather.h:47
Map * m_map
Definition Weather.h:88
WeatherSeasonChances data[WEATHER_SEASONS]
Definition Weather.h:42
uint32 GetZone() const
For which zone is this weather?
Definition Weather.h:82
#define WEATHER_SEASONS
Definition Weather.h:32
~Weather()
Definition Weather.h:71
uint32 ScriptId
Definition Weather.h:43
IntervalTimer m_timer
Definition Weather.h:92
WeatherData const * m_weatherChances
Definition Weather.h:93
@ WEATHER_STATE_THUNDERS
Definition Weather.h:60
@ WEATHER_STATE_HEAVY_RAIN
Definition Weather.h:53
@ WEATHER_STATE_HEAVY_SANDSTORM
Definition Weather.h:59
@ WEATHER_STATE_MEDIUM_SNOW
Definition Weather.h:55
@ WEATHER_STATE_MEDIUM_RAIN
Definition Weather.h:52
@ WEATHER_STATE_MEDIUM_SANDSTORM
Definition Weather.h:58
@ WEATHER_STATE_BLACKSNOW
Definition Weather.h:62
@ WEATHER_STATE_FINE
Definition Weather.h:48
@ WEATHER_STATE_DRIZZLE
Definition Weather.h:50
@ WEATHER_STATE_LIGHT_SNOW
Definition Weather.h:54
@ WEATHER_STATE_BLACKRAIN
Definition Weather.h:61
@ WEATHER_STATE_HEAVY_SNOW
Definition Weather.h:56
@ WEATHER_STATE_LIGHT_SANDSTORM
Definition Weather.h:57
@ WEATHER_STATE_FOG
Definition Weather.h:49
@ WEATHER_STATE_LIGHT_RAIN
Definition Weather.h:51