[6982] Implemented gmlevel-based command security
[getmangos.git] / src / game / Weather.h
blob2ed41783ada363229d30bb994491788469d9463d
1 /*
2 * Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 /// \addtogroup world
20 /// @{
21 /// \file
23 #ifndef __WEATHER_H
24 #define __WEATHER_H
26 #include "Common.h"
27 #include "SharedDefines.h"
28 #include "Timer.h"
30 class Player;
32 enum WeatherState
34 WEATHER_STATE_FINE = 0,
35 WEATHER_STATE_LIGHT_RAIN = 3,
36 WEATHER_STATE_MEDIUM_RAIN = 4,
37 WEATHER_STATE_HEAVY_RAIN = 5,
38 WEATHER_STATE_LIGHT_SNOW = 6,
39 WEATHER_STATE_MEDIUM_SNOW = 7,
40 WEATHER_STATE_HEAVY_SNOW = 8,
41 WEATHER_STATE_LIGHT_SANDSTORM = 22,
42 WEATHER_STATE_MEDIUM_SANDSTORM = 41,
43 WEATHER_STATE_HEAVY_SANDSTORM = 42,
44 WEATHER_STATE_THUNDERS = 86,
45 WEATHER_STATE_BLACKRAIN = 90
48 struct WeatherZoneChances;
50 /// Weather for one zone
51 class Weather
53 public:
54 Weather(uint32 zone, WeatherZoneChances const* weatherChances);
55 ~Weather() { };
56 bool ReGenerate();
57 bool UpdateWeather();
58 void SendWeatherUpdateToPlayer(Player *player);
59 static void SendFineWeatherUpdateToPlayer(Player *player);
60 void SetWeather(WeatherType type, float grade);
61 /// For which zone is this weather?
62 uint32 GetZone() { return m_zone; };
63 bool Update(time_t diff);
64 private:
65 WeatherState GetWeatherState() const;
66 uint32 m_zone;
67 WeatherType m_type;
68 float m_grade;
69 IntervalTimer m_timer;
70 WeatherZoneChances const* m_weatherChances;
72 #endif