GameServer
AreaMaster.h
[詳解]
1 #ifndef __AREAMASTER_H__
2 #define __AREAMASTER_H__
3 
4 #include <map>
5 #include <vector>
6 
7 class MySqlConnection;
8 
9 struct AreaItem
10 {
11 
12 public:
13 
14  enum
15  {
18  };
19 
20 
22  std::string Name;
23  std::string LevelName;
26 
27 
28 };
29 
30 bool operator <(const AreaItem &A, const AreaItem &B);
31 bool operator >(const AreaItem &A, const AreaItem &B);
32 
34 {
35 
36 private:
37 
38  typedef std::map<u32, AreaItem> ItemMap;
39  typedef std::map<int, ItemMap> SheetMap;
40 
41 public:
42 
43  bool Load(const MySqlConnection &Connection);
44 
45  const AreaItem *GetItem(u32 Key, s32 SheetIndex = 0) const;
46 
47  std::vector<AreaItem> GetAllSheetItem(s32 SheetIndex) const;
48 
49  std::vector<AreaItem> GetAll() const;
50 
51 private:
52 
53  SheetMap Items;
54 
55 };
56 
57 #endif // #ifndef __AREAMASTER_H__
unsigned char u8
Definition: TypeDefs.h:6
u32 InstanceInfoId
Definition: AreaMaster.h:25
Definition: AreaMaster.h:17
bool operator<(const AreaItem &A, const AreaItem &B)
Definition: AreaMaster.cpp:76
bool Load(const MySqlConnection &Connection)
Definition: AreaMaster.cpp:5
u32 ID
Definition: AreaMaster.h:21
const AreaItem * GetItem(u32 Key, s32 SheetIndex=0) const
Definition: AreaMaster.cpp:36
std::vector< AreaItem > GetAllSheetItem(s32 SheetIndex) const
Definition: AreaMaster.cpp:45
Definition: MySqlConnection.h:15
int s32
Definition: TypeDefs.h:9
unsigned int u32
Definition: TypeDefs.h:10
Definition: AreaMaster.h:33
bool operator>(const AreaItem &A, const AreaItem &B)
Definition: AreaMaster.cpp:81
std::string Name
Definition: AreaMaster.h:22
Definition: AreaMaster.h:16
std::string LevelName
Definition: AreaMaster.h:23
u8 Type
Definition: AreaMaster.h:24
std::vector< AreaItem > GetAll() const
Definition: AreaMaster.cpp:61
Definition: AreaMaster.h:9