Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Weather.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
9
10#ifndef SF_WEATHER_H
11#define SF_WEATHER_H
12
13#include "Common.h"
14#include "SharedDefines.h"
15#include "Timer.h"
16
17class Player;
18
19#define WEATHER_SEASONS 4
26
32
50
53{
54public:
55 Weather(uint32 zone, WeatherData const* weatherChances);
56 ~Weather() { };
57
58 bool Update(uint32 diff);
59 bool ReGenerate();
60 bool UpdateWeather();
61
63 void SetWeather(WeatherType type, float grade);
64
66 uint32 GetZone() const { return m_zone; };
67 uint32 GetScriptId() const { return m_weatherChances->ScriptId; }
68
69private:
73 float m_grade;
76};
77#endif
std::uint32_t uint32
Definition Define.h:77
WeatherType
uint32 GetScriptId() const
Definition Weather.h:67
WeatherType m_type
Definition Weather.h:72
uint32 m_zone
Definition Weather.h:71
WeatherState
Definition Weather.h:34
void SetWeather(WeatherType type, float grade)
Set the weather.
Definition Weather.cpp:267
WeatherSeasonChances data[WEATHER_SEASONS]
Definition Weather.h:29
float m_grade
Definition Weather.h:73
uint32 GetZone() const
For which zone is this weather?
Definition Weather.h:66
#define WEATHER_SEASONS
Definition Weather.h:19
~Weather()
Definition Weather.h:56
uint32 ScriptId
Definition Weather.h:30
bool UpdateWeather()
Send the new weather to all players in the zone.
Definition Weather.cpp:194
IntervalTimer m_timer
Definition Weather.h:74
bool ReGenerate()
Calculate the new weather.
Definition Weather.cpp:59
WeatherData const * m_weatherChances
Definition Weather.h:75
WeatherState GetWeatherState() const
Get the sound number associated with the current weather.
Definition Weather.cpp:278
Weather(uint32 zone, WeatherData const *weatherChances)
Create the Weather object.
Definition Weather.cpp:23
bool Update(uint32 diff)
Launch a weather update.
Definition Weather.cpp:34
void SendWeatherUpdateToPlayer(Player *player)
Definition Weather.cpp:183
@ WEATHER_STATE_THUNDERS
Definition Weather.h:46
@ WEATHER_STATE_HEAVY_RAIN
Definition Weather.h:39
@ WEATHER_STATE_HEAVY_SANDSTORM
Definition Weather.h:45
@ WEATHER_STATE_MEDIUM_SNOW
Definition Weather.h:41
@ WEATHER_STATE_MEDIUM_RAIN
Definition Weather.h:38
@ WEATHER_STATE_MEDIUM_SANDSTORM
Definition Weather.h:44
@ WEATHER_STATE_BLACKSNOW
Definition Weather.h:48
@ WEATHER_STATE_FINE
Definition Weather.h:35
@ WEATHER_STATE_LIGHT_SNOW
Definition Weather.h:40
@ WEATHER_STATE_BLACKRAIN
Definition Weather.h:47
@ WEATHER_STATE_HEAVY_SNOW
Definition Weather.h:42
@ WEATHER_STATE_LIGHT_SANDSTORM
Definition Weather.h:43
@ WEATHER_STATE_FOG
Definition Weather.h:36
@ WEATHER_STATE_LIGHT_RAIN
Definition Weather.h:37