My Project
CharacterDB.h
1 #pragma once
2 #include "ic/ParaDatabase.h"
3 
4 namespace ParaEngine
5 {
9  {
10  public:
12  static CCharacterDB& GetInstance();
13 
15  void CloseDB();
16 
18  bool CheckLoad();
19 
21  void ResetDataBase();
22 
23  public:
26  bool GetRaceIDbyName(const string& racename, int& id);
27 
30  bool GetRaceShortNamebyRaceID(int id, string& racename);
31 
34  bool GetModelIDfromModelFile(const string& sModelFile, int& modelid, int& modeltype);
35 
39  bool GetReplaceTexturesByModelIDAndSkinID(int modelid, int skinIndex, string& sReplaceTexture0, string& sReplaceTexture1, string& sReplaceTexture2, bool& bFound);
40 
43  bool GetCharacterSkins(int race, int gender, int nSectionType, int nSection, int skinColor, string& sSkinTexture0, string& sSkinTexture1, string& sSkinTexture2);
44 
47  bool GetFacialHairGeosets(int race, int gender, int facialHair, int& geoset1, int& geoset2,int& geoset3);
48 
51  bool GetHairGeosets(int race, int gender, int hairStyle, int& geoset);
52 
55  bool GetModelIDfromItemID(int itemid, int& nItemType, int&nItemModelID);
56 
60  bool GetModelDisplayInfo(int nItemModelID, int& GeosetA, int& GeosetB, int& GeosetC, int& GeosetD, int& GeosetE,
61  int& flags, int& GeosetVisID1, int& GeosetVisID2,
62  string& skin, string& skin2, string& TexArmUpper, string& TexArmLower, string& TexHands, string& TexChestUpper,
63  string& TexChestLower, string& TexLegUpper, string& TexLegLower,string& TexFeet);
64 
67  bool GetModelInfoFromModelID(int nItemModelID, string& Model, string& Model2, string& Skin, string& Skin2,
68  int& visualid,int& GeosetVisID1, int& GeosetVisID2);
69 
72  bool GetItemSetsBySetID(int setid, void* itemsets, int nSize);
75  bool GetItemTypeByItemID(int itemid, int& itemtype);
76 
96  bool GetCartoonFaceComponent(int nType, int nStyle, string* sTex1,string* sTex2, string* sIconPath );
97 
98  protected:
99  private:
100  CCharacterDB();
101  ~CCharacterDB();
102 
103  static void ConvertModelName(string& sName);
105  asset_ptr<ParaInfoCenter::DBEntity> m_pDataBase;
106  bool m_bIsValid;
107  };
108 }
bool GetCharacterSkins(int race, int gender, int nSectionType, int nSection, int skinColor, string &sSkinTexture0, string &sSkinTexture1, string &sSkinTexture2)
get the character&#39;s skin textures with a specified section type and section number.
Definition: CharacterDB.cpp:146
bool GetModelIDfromItemID(int itemid, int &nItemType, int &nItemModelID)
get item&#39;s model type and model id by its item id.
Definition: CharacterDB.cpp:222
bool GetModelIDfromModelFile(const string &sModelFile, int &modelid, int &modeltype)
get the model ID from model asset file name return true if the record is found in database...
Definition: CharacterDB.cpp:77
bool GetModelInfoFromModelID(int nItemModelID, string &Model, string &Model2, string &Skin, string &Skin2, int &visualid, int &GeosetVisID1, int &GeosetVisID2)
get the model information from the model display database by the model id return true if the record i...
Definition: CharacterDB.cpp:312
different physics engine has different winding order.
Definition: EventBinding.h:32
bool GetRaceShortNamebyRaceID(int id, string &racename)
Get race short name from race id return true if the record is found in database.
Definition: CharacterDB.cpp:350
bool CheckLoad()
check if database is valid or not.
Definition: CharacterDB.cpp:24
bool GetHairGeosets(int race, int gender, int hairStyle, int &geoset)
get the hair style geoset.
Definition: CharacterDB.cpp:199
bool GetRaceIDbyName(const string &racename, int &id)
Get race ID from name return true if the record is found in database.
Definition: CharacterDB.cpp:60
bool GetItemSetsBySetID(int setid, void *itemsets, int nSize)
get the item set.
Definition: CharacterDB.cpp:368
void CloseDB()
clean up.
Definition: CharacterDB.cpp:38
bool GetModelDisplayInfo(int nItemModelID, int &GeosetA, int &GeosetB, int &GeosetC, int &GeosetD, int &GeosetE, int &flags, int &GeosetVisID1, int &GeosetVisID2, string &skin, string &skin2, string &TexArmUpper, string &TexArmLower, string &TexHands, string &TexChestUpper, string &TexChestLower, string &TexLegUpper, string &TexLegLower, string &TexFeet)
get item display information by its model item id.
Definition: CharacterDB.cpp:248
void ResetDataBase()
TODO: recreate a blank database.
bool GetReplaceTexturesByModelIDAndSkinID(int modelid, int skinIndex, string &sReplaceTexture0, string &sReplaceTexture1, string &sReplaceTexture2, bool &bFound)
get the replaceable texture group for the specified index.
Definition: CharacterDB.cpp:96
bool GetItemTypeByItemID(int itemid, int &itemtype)
get the item&#39;s type by its item id return true if the record is found in database.
Definition: CharacterDB.cpp:387
bool GetFacialHairGeosets(int race, int gender, int facialHair, int &geoset1, int &geoset2, int &geoset3)
get the facial hair&#39;s geosets ids.
Definition: CharacterDB.cpp:167
static CCharacterDB & GetInstance()
get the singleton class.
Definition: CharacterDB.cpp:54
it contains all functions to access the character database.
Definition: CharacterDB.h:8
bool GetCartoonFaceComponent(int nType, int nStyle, string *sTex1, string *sTex2, string *sIconPath)
Definition: CharacterDB.cpp:405