My Project
Public Member Functions | Static Public Member Functions | List of all members
ParaEngine::CCharacterDB Class Reference

it contains all functions to access the character database. More...

#include <CharacterDB.h>

Public Member Functions

void CloseDB ()
 clean up. More...
 
bool CheckLoad ()
 check if database is valid or not. More...
 
void ResetDataBase ()
 TODO: recreate a blank database. More...
 
bool GetRaceIDbyName (const string &racename, int &id)
 Get race ID from name return true if the record is found in database. More...
 
bool GetRaceShortNamebyRaceID (int id, string &racename)
 Get race short name from race id return true if the record is found in database. More...
 
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. More...
 
bool GetReplaceTexturesByModelIDAndSkinID (int modelid, int skinIndex, string &sReplaceTexture0, string &sReplaceTexture1, string &sReplaceTexture2, bool &bFound)
 get the replaceable texture group for the specified index. More...
 
bool GetCharacterSkins (int race, int gender, int nSectionType, int nSection, int skinColor, string &sSkinTexture0, string &sSkinTexture1, string &sSkinTexture2)
 get the character's skin textures with a specified section type and section number. More...
 
bool GetFacialHairGeosets (int race, int gender, int facialHair, int &geoset1, int &geoset2, int &geoset3)
 get the facial hair's geosets ids. More...
 
bool GetHairGeosets (int race, int gender, int hairStyle, int &geoset)
 get the hair style geoset. More...
 
bool GetModelIDfromItemID (int itemid, int &nItemType, int &nItemModelID)
 get item's model type and model id by its item id. More...
 
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. More...
 
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 is found in database. More...
 
bool GetItemSetsBySetID (int setid, void *itemsets, int nSize)
 get the item set. More...
 
bool GetItemTypeByItemID (int itemid, int &itemtype)
 get the item's type by its item id return true if the record is found in database. More...
 
bool GetCartoonFaceComponent (int nType, int nStyle, string *sTex1, string *sTex2, string *sIconPath)
 

Static Public Member Functions

static CCharacterDBGetInstance ()
 get the singleton class. More...
 

Detailed Description

it contains all functions to access the character database.

This is a singleton class. call GetInstance() to use this class.

Member Function Documentation

§ CheckLoad()

bool ParaEngine::CCharacterDB::CheckLoad ( )

check if database is valid or not.

§ CloseDB()

void CCharacterDB::CloseDB ( )

clean up.

§ GetCartoonFaceComponent()

bool CCharacterDB::GetCartoonFaceComponent ( int  nType,
int  nStyle,
string *  sTex1,
string *  sTex2,
string *  sIconPath 
)
Parameters
nTypetype of CartoonFaceSlots enum CartoonFaceSlots { CFS_FACE = 0, CFS_WRINKLE = 1, CFS_EYE = 2, CFS_EYEBROW = 3, CFS_MOUTH = 4, CFS_NOSE = 5, CFS_MARKS = 6, };
nStylestarting from 0
sTex1out texture path
sTex2out texture path
sIconPathout texture icon path
Returns
:true if succeed.

§ GetCharacterSkins()

bool CCharacterDB::GetCharacterSkins ( int  race,
int  gender,
int  nSectionType,
int  nSection,
int  skinColor,
string &  sSkinTexture0,
string &  sSkinTexture1,
string &  sSkinTexture2 
)

get the character's skin textures with a specified section type and section number.

return true if the record is found in database.

§ GetFacialHairGeosets()

bool CCharacterDB::GetFacialHairGeosets ( int  race,
int  gender,
int  facialHair,
int &  geoset1,
int &  geoset2,
int &  geoset3 
)

get the facial hair's geosets ids.

return true if the record is found in database.

§ GetHairGeosets()

bool CCharacterDB::GetHairGeosets ( int  race,
int  gender,
int  hairStyle,
int &  geoset 
)

get the hair style geoset.

return true if the record is found in database.

§ GetInstance()

CCharacterDB & CCharacterDB::GetInstance ( )
static

get the singleton class.

§ GetItemSetsBySetID()

bool CCharacterDB::GetItemSetsBySetID ( int  setid,
void *  itemsets,
int  nSize 
)

get the item set.

return true if the record is found in database.

§ GetItemTypeByItemID()

bool CCharacterDB::GetItemTypeByItemID ( int  itemid,
int &  itemtype 
)

get the item's type by its item id return true if the record is found in database.

§ GetModelDisplayInfo()

bool CCharacterDB::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.

The display information will describe how the item (equipment) is displayed on the body of a character. return true if the record is found in database.

§ GetModelIDfromItemID()

bool CCharacterDB::GetModelIDfromItemID ( int  itemid,
int &  nItemType,
int &  nItemModelID 
)

get item's model type and model id by its item id.

return true if the record is found in database.

§ GetModelIDfromModelFile()

bool CCharacterDB::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.

§ GetModelInfoFromModelID()

bool CCharacterDB::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 is found in database.

§ GetRaceIDbyName()

bool CCharacterDB::GetRaceIDbyName ( const string &  racename,
int &  id 
)

Get race ID from name return true if the record is found in database.

§ GetRaceShortNamebyRaceID()

bool CCharacterDB::GetRaceShortNamebyRaceID ( int  id,
string &  racename 
)

Get race short name from race id return true if the record is found in database.

§ GetReplaceTexturesByModelIDAndSkinID()

bool CCharacterDB::GetReplaceTexturesByModelIDAndSkinID ( int  modelid,
int  skinIndex,
string &  sReplaceTexture0,
string &  sReplaceTexture1,
string &  sReplaceTexture2,
bool &  bFound 
)

get the replaceable texture group for the specified index.

return true if the model is found.but it does not mean that the skin ID is found.

Parameters
bFoundwhether found

§ ResetDataBase()

void ParaEngine::CCharacterDB::ResetDataBase ( )

TODO: recreate a blank database.


The documentation for this class was generated from the following files: