GameServer
ShopMaster.h
[詳解]
1 #ifndef __SHOPMASTER_H__
2 #define __SHOPMASTER_H__
3 
4 #include <map>
5 #include <vector>
6 
7 class MySqlConnection;
8 
9 struct ShopItem
10 {
11 
12 public:
13 
14 
15 
19 
20 
21 };
22 
23 bool operator <(const ShopItem &A, const ShopItem &B);
24 bool operator >(const ShopItem &A, const ShopItem &B);
25 
27 {
28 
29 private:
30 
31  typedef std::map<u32, ShopItem> ItemMap;
32  typedef std::map<int, ItemMap> SheetMap;
33 
34 public:
35 
36  bool Load(const MySqlConnection &Connection);
37 
38  std::vector<const ShopItem *> CollectItems(u32 Key, s32 SheetIndex = 0) const;
39 
40  std::vector<ShopItem> GetAllSheetItem(s32 SheetIndex) const;
41 
42  std::vector<ShopItem> GetAll() const;
43 
44 private:
45 
46  SheetMap Items;
47 
48 };
49 
50 #endif // #ifndef __SHOPMASTER_H__
std::vector< ShopItem > GetAllSheetItem(s32 SheetIndex) const
Definition: ShopMaster.cpp:48
std::vector< ShopItem > GetAll() const
Definition: ShopMaster.cpp:64
Definition: ShopMaster.h:26
bool Load(const MySqlConnection &Connection)
Definition: ShopMaster.cpp:5
Definition: MySqlConnection.h:15
int s32
Definition: TypeDefs.h:9
unsigned int u32
Definition: TypeDefs.h:10
Definition: ShopMaster.h:9
s32 AutoKey
Definition: ShopMaster.h:16
std::vector< const ShopItem * > CollectItems(u32 Key, s32 SheetIndex=0) const
Definition: ShopMaster.cpp:32
u32 ID
Definition: ShopMaster.h:17
u32 ItemId
Definition: ShopMaster.h:18
bool operator<(const ShopItem &A, const ShopItem &B)
Definition: ShopMaster.cpp:79
bool operator>(const ShopItem &A, const ShopItem &B)
Definition: ShopMaster.cpp:84