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