root/trunk/src/game/Weather.h @ 13

Revision 2, 2.2 kB (checked in by yumileroy, 17 years ago)

[svn] * Proper SVN structure

Original author: Neo2003
Date: 2008-10-02 16:23:55-05:00

Line 
1/*
2 * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
3 *
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.
8 *
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.
13 *
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
17 */
18
19/// \addtogroup world
20/// @{
21/// \file
22
23#ifndef __WEATHER_H
24#define __WEATHER_H
25
26#include "Common.h"
27#include "SharedDefines.h"
28#include "Timer.h"
29
30class Player;
31
32enum WeatherState
33{
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
46};
47
48struct WeatherZoneChances;
49
50/// Weather for one zone
51class Weather
52{
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;
71};
72#endif
Note: See TracBrowser for help on using the browser.