TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Weather.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
22 
23 #ifndef __WEATHER_H
24 #define __WEATHER_H
25 
26 #include "Common.h"
27 #include "SharedDefines.h"
28 #include "Timer.h"
29 
30 class Player;
31 
32 #define WEATHER_SEASONS 4
34 {
38 };
39 
41 {
44 };
45 
47 {
49  WEATHER_STATE_FOG = 1, // Used in some instance encounters.
62 };
63 
66 {
67  public:
68 
69  Weather(uint32 zone, WeatherData const* weatherChances);
70  ~Weather() { };
71 
72  bool Update(uint32 diff);
73  bool ReGenerate();
74  bool UpdateWeather();
75 
76  void SendWeatherUpdateToPlayer(Player* player);
77  void SetWeather(WeatherType type, float grade);
78 
80  uint32 GetZone() const { return m_zone; };
81  uint32 GetScriptId() const { return m_weatherChances->ScriptId; }
82 
83  private:
84 
85  WeatherState GetWeatherState() const;
88  float m_grade;
91 };
92 #endif
Definition: Weather.h:49
Definition: Weather.h:60
Definition: Weather.h:57
Definition: Weather.h:53
Definition: Weather.h:59
WeatherSeasonChances data[WEATHER_SEASONS]
Definition: Weather.h:42
Definition: Weather.h:55
Definition: Weather.h:52
Definition: Weather.h:33
uint32 ScriptId
Definition: Weather.h:43
WeatherType m_type
Definition: Weather.h:87
~Weather()
Definition: Weather.h:70
IntervalTimer m_timer
Definition: Weather.h:89
uint32 GetScriptId() const
Definition: Weather.h:81
float m_grade
Definition: Weather.h:88
Definition: Weather.h:48
WeatherData const * m_weatherChances
Definition: Weather.h:90
uint32_t uint32
Definition: Define.h:150
Definition: Weather.h:54
Definition: Weather.h:61
uint32 snowChance
Definition: Weather.h:36
Definition: Weather.h:51
Definition: Weather.h:50
#define TC_GAME_API
Definition: Define.h:134
uint32 GetZone() const
For which zone is this weather?
Definition: Weather.h:80
Definition: Weather.h:56
uint32 stormChance
Definition: Weather.h:37
WeatherType
Definition: SharedDefines.h:4216
Definition: Weather.h:58
Weather for one zone.
Definition: Weather.h:65
uint32 m_zone
Definition: Weather.h:86
uint32 rainChance
Definition: Weather.h:35
WeatherState
Definition: Weather.h:46
void Update(uint32 diff)
Definition: WeatherMgr.cpp:150
Definition: Timer.h:47
#define WEATHER_SEASONS
Definition: Weather.h:32
Definition: Weather.h:40