OregonCore  revision fb2a440-git
Your Favourite TBC server
Weather.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore 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 
18 #ifndef __WEATHER_H
19 #define __WEATHER_H
20 
21 #include "Common.h"
22 #include "SharedDefines.h"
23 #include "Timer.h"
24 
25 class Player;
26 
28 {
41 };
42 
43 struct WeatherZoneChances;
44 
45 // Weather for one zone
46 class Weather
47 {
48  public:
49  Weather(uint32 zone, WeatherZoneChances const* weatherChances);
50  ~Weather() { };
51  bool ReGenerate();
52  bool UpdateWeather();
53  void SendWeatherUpdateToPlayer(Player* player);
54  static void SendFineWeatherUpdateToPlayer(Player* player);
55  void SetWeather(WeatherType type, float grade);
56  // For which zone is this weather?
58  {
59  return m_zone;
60  };
61  bool Update(time_t diff);
62  private:
66  float m_grade;
69 };
70 #endif
71 
float m_grade
Definition: Weather.h:66
WeatherState
Definition: Weather.h:27
uint32 m_zone
Definition: Weather.h:64
WeatherZoneChances const * m_weatherChances
Definition: Weather.h:68
bool ReGenerate()
Definition: Weather.cpp:60
Weather(uint32 zone, WeatherZoneChances const *weatherChances)
Definition: Weather.cpp:28
WeatherType m_type
Definition: Weather.h:65
WeatherState GetWeatherState() const
Definition: Weather.cpp:276
bool UpdateWeather()
Definition: Weather.cpp:198
uint32 GetZone()
Definition: Weather.h:57
static void SendFineWeatherUpdateToPlayer(Player *player)
Definition: Weather.cpp:188
~Weather()
Definition: Weather.h:50
IntervalTimer m_timer
Definition: Weather.h:67
void SendWeatherUpdateToPlayer(Player *player)
Definition: Weather.cpp:179
WeatherType
ACE_UINT32 uint32
Definition: Define.h:71
void SetWeather(WeatherType type, float grade)
Definition: Weather.cpp:265
Definition: Player.h:922
bool Update(time_t diff)
Definition: Weather.cpp:38