My Project
CharacterDBProvider.h
1 #pragma once
2 #include "ic/ParaDatabase.h"
3 
4 #include ".\StringTable.h"
5 
6 namespace ParaEngine
7 {
9  {
11  __int64 ID;
12  stStringTableDbRecord CharacterName; // record in string table
13  int NumberOfPets; // limit the pet number to 3
14  __int64 MainPetIndex; // index in pet table
15  __int64 SecondaryPetIndex; // index in pet table
16  __int64 ThirdPetIndex; // index in pet table
17 
19  string AssetName;
20  bool IsGlobal;
21  bool IsSnapToTerrain;
22 
25  float CharacterModelScale;
26  float CharacterRadius;
27  float CharacterFacing;
28  float posX;
29  float posY;
30  float posZ;
31 
35  float SentientRadius;
36  string OnLoadScript;
37 
40  __int64 CharacterTitleIndex; // index in title table
41  int ExperiencePt;
43  int Orange;
44  int Apple;
45  int Peach;
46 
48  string Reserved1;
49  string Reserved2;
50  string Reserved3;
51  string Reserved4;
52  string Reserved5;
53  };
54 
55  // Class CCharacterDBProvider: CCharacterDBProvider contains all functions to access the
56  // character database and the user interface data of character control.
57  // This is a singleton class. Call GetInstance() to use this class.
59  {
60  public:
63  ~CCharacterDBProvider(void);
64 
65  protected:
66  private:
67 
69  ParaEngine::asset_ptr<ParaInfoCenter::DBEntity> m_pDataBase;
70 
71  public:
73  static CCharacterDBProvider & GetInstance();
75  ParaInfoCenter::DBEntity* GetDBEntity();
77  void SetDBEntity(ParaInfoCenter::DBEntity* pDb);
78 
79 //#define TEST_CHARACTER
80 #ifdef TEST_CHARACTER
81  public:
82  // TODO: only for test
83  void TestDB();
84 #endif
85 
86  public:
91  bool InsertCharacterRecord(stCharacterDbRecord& record);
92 
97  bool DeleteCharacterRecordByID(int ID);
98  };
99 }
float PerceptiveRadius
AI Related Attribute.
Definition: CharacterDBProvider.h:34
string CharacterModeFilePath
Appearance Related Attribute.
Definition: CharacterDBProvider.h:24
different physics engine has different winding order.
Definition: EventBinding.h:32
int Orange
TODO: Change according to game design.
Definition: CharacterDBProvider.h:43
Definition: CharacterDBProvider.h:8
__int64 ID
Common Attribute.
Definition: CharacterDBProvider.h:11
__int64 CharacterTitleIndex
Kids Game Related Attribute.
Definition: CharacterDBProvider.h:40
string AssetName
Engine Asset Management Attribute.
Definition: CharacterDBProvider.h:19
Definition: StringTable.h:7
a single database file.
Definition: ICDBManager.h:39
Definition: CharacterDBProvider.h:58
string Reserved1
Reserved Attribute.
Definition: CharacterDBProvider.h:48