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