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