-
Notifications
You must be signed in to change notification settings - Fork 0
/
WeatherEventManager.h
65 lines (49 loc) · 1.92 KB
/
WeatherEventManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once
#include <MeFoundation/MeCycleTimer.h>
#include <MeFoundation/MeTimeLine.h>
class WeatherEventManager : public Singleton< WeatherEventManager >
{
// Defines.
public:
typedef MeTimeline< MeCycleTimer< 3600 * 5 * 1000, MeClockTimer > > WeatherEventTimeline;
typedef std::map< int , WeatherEventTimeline* > WeatherEventTimelines;
typedef WeatherEventTimelines::iterator WeatherEventTimelinesIterator;
typedef WeatherEventTimelines::const_iterator WeatherEventTimelinesConstIterator;
// Construction.
public:
~WeatherEventManager(){}
// Construction.
private:
friend class Singleton< WeatherEventManager >;
WeatherEventManager(){
m_nMapId = -1;
}
// Methods.
public:
void DestoryWeather();
void InitializeWeather( const std::string& strFilename);
void UpdateWeather();
void RenderWeather();
void StopWeather();
void UpdateWorldData( int nMapId );
void StartWeatherTime( int nMapId, const MeTimeValue& kStartTime );
// Static Methods.
public:
static void ResetEventWithWorldData( MeTimelineEventBase* pEvent );
static void SendCurrentRolePositionInfo( MeTimelineEventBase* pEvent );
// Methods.
protected:
/// CloudySky Read.
void LoadCloudySkyConfig();
// Members.
protected:
WeatherEventTimelines m_mapTimelines;
int m_nMapId;
};
//////////////////////////////////////////////////////////////////////////
// sample for config
/*/========================================================================================================================================================\*\
<WeatherTimeline>
<Event Type = "0" Mapid = "2" TimeRatio = "5" StartTime = "0" EndTime = "7000" ToFull = "2000" ToEnd = "5000" DestAmbient = "255,55,55,55" DestDiffuse = "255,55,55,55" />
</WeatherTimeline>
\*\========================================================================================================================================================/*/