GameServer
TimeInfoMaster.h
[詳解]
1 #ifndef __TIMEINFOMASTER_H__
2 #define __TIMEINFOMASTER_H__
3 
4 #include <map>
5 #include <vector>
6 
7 class MySqlConnection;
8 
10 {
11 
12 public:
13 
14  enum
15  {
16  MORNING = 0,
17  AFTERNOON = 1,
18  EVENING = 2,
19  NIGHT = 3,
20  };
21 
22 
25  float LightAngle;
26  float CloudSpeed;
27  float CloudOpacity;
29 
30 
31 };
32 
33 bool operator <(const TimeInfoItem &A, const TimeInfoItem &B);
34 bool operator >(const TimeInfoItem &A, const TimeInfoItem &B);
35 
37 {
38 
39 private:
40 
41  typedef std::map<u32, TimeInfoItem> ItemMap;
42  typedef std::map<int, ItemMap> SheetMap;
43 
44 public:
45 
46  bool Load(const MySqlConnection &Connection);
47 
48  const TimeInfoItem *GetItem(u32 Key, s32 SheetIndex = 0) const;
49 
50  std::vector<TimeInfoItem> GetAllSheetItem(s32 SheetIndex) const;
51 
52  std::vector<TimeInfoItem> GetAll() const;
53 
54 private:
55 
56  SheetMap Items;
57 
58 };
59 
60 #endif // #ifndef __TIMEINFOMASTER_H__
bool operator>(const TimeInfoItem &A, const TimeInfoItem &B)
Definition: TimeInfoMaster.cpp:83
bool Load(const MySqlConnection &Connection)
Definition: TimeInfoMaster.cpp:5
unsigned char u8
Definition: TypeDefs.h:6
float LightAngle
Definition: TimeInfoMaster.h:25
u8 TimeType
Definition: TimeInfoMaster.h:24
Definition: TimeInfoMaster.h:36
Definition: TimeInfoMaster.h:18
Definition: TimeInfoMaster.h:19
Definition: TimeInfoMaster.h:17
float CloudSpeed
Definition: TimeInfoMaster.h:26
Definition: MySqlConnection.h:15
float CloudOpacity
Definition: TimeInfoMaster.h:27
std::vector< TimeInfoItem > GetAllSheetItem(s32 SheetIndex) const
Definition: TimeInfoMaster.cpp:47
Definition: TimeInfoMaster.h:9
int s32
Definition: TypeDefs.h:9
bool operator<(const TimeInfoItem &A, const TimeInfoItem &B)
Definition: TimeInfoMaster.cpp:78
unsigned int u32
Definition: TypeDefs.h:10
float StarsBrightness
Definition: TimeInfoMaster.h:28
Definition: TimeInfoMaster.h:16
const TimeInfoItem * GetItem(u32 Key, s32 SheetIndex=0) const
Definition: TimeInfoMaster.cpp:38
std::vector< TimeInfoItem > GetAll() const
Definition: TimeInfoMaster.cpp:63
u32 Id
Definition: TimeInfoMaster.h:23