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

Public Member Functions

bool IsValid ()
 whether db is opened. More...
 
void Cleanup ()
 delete the database and set everything to NULL
 
DBEntityGetDBEntity ()
 get the database object associated with this provider
 
void SetDBEntity (const string &sConnectionstring)
 replace the current database with current one. More...
 
void ValidateDatabase ()
 ensure that the database has been set up properly. More...
 
bool InsertPuzzleRecordFromString (const string &strRecord)
 Insert the new puzzle record to Puzzle_DB. More...
 
bool DeletePuzzleRecordByID (int ID)
 delete the existing puzzle record from Puzzle_DB More...
 
bool InsertItemRecordFromString (const string &strRecord)
 Insert the new item record to Item_DB. More...
 
bool DeleteItemRecordByID (int ID)
 delete the existing item record from Item_DB More...
 
bool UpdateItemRecordFromString (const string &strRecord)
 Update existing item record of Item_DB. More...
 
const char * SelectItemRecordToString (__int64 ID)
 Select existing item record of Item_DB. More...
 
bool InsertCharacterRecordFromString (const string &strRecord)
 Insert the new character record to Character_DB. More...
 
bool DeleteCharacterRecordByID (int ID)
 delete the existing puzzle record from Character_DB More...
 
bool InsertChestRecordFromString (const string &strRecord)
 Insert the new chest record to Chest_DB. More...
 
bool DeleteChestRecordByID (int ID)
 delete the existing chest record from Chest_DB More...
 
bool InsertFruitRecordFromString (const string &strRecord)
 Insert the new fruit record to Fruit_DB. More...
 
bool DeleteFruitRecordByID (int ID)
 delete the existing fruit record from Fruit_DB More...
 
bool InsertPetAIRecordFromString (const string &strRecord)
 Insert the new petAI record to PetAI_DB. More...
 
bool DeletePetAIRecordByID (int ID)
 delete the existing petAI record from PetAI_DB More...
 
bool InsertPetRecordFromString (const string &strRecord)
 Insert the new pet record to Pet_DB. More...
 
bool DeletePetRecordByID (int ID)
 delete the existing pet record from Pet_DB More...
 
bool InsertQuestRecordFromString (const string &strRecord)
 Insert the new quest record to Quest_DB. More...
 
bool DeleteQuestRecordByID (int ID)
 delete the existing quest record from Quest_DB More...
 
bool InsertTitleRecordFromString (const string &strRecord)
 Insert the new title record to Title_DB. More...
 
bool DeleteTitleRecordByID (int ID)
 delete the existing title record from Title_DB More...
 

Static Public Member Functions

static string GetStringbyID (int ID)
 Get string from ID. More...
 
static int InsertString (const char *strEN, const char *strCN)
 Insert the new string table entry to StringTable_DB. More...
 

Member Function Documentation

§ DeleteCharacterRecordByID()

bool CKidsDBProvider::DeleteCharacterRecordByID ( int  ID)

delete the existing puzzle record from Character_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ DeleteChestRecordByID()

bool CKidsDBProvider::DeleteChestRecordByID ( int  ID)

delete the existing chest record from Chest_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ DeleteFruitRecordByID()

bool CKidsDBProvider::DeleteFruitRecordByID ( int  ID)

delete the existing fruit record from Fruit_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ DeleteItemRecordByID()

bool CKidsDBProvider::DeleteItemRecordByID ( int  ID)

delete the existing item record from Item_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ DeletePetAIRecordByID()

bool CKidsDBProvider::DeletePetAIRecordByID ( int  ID)

delete the existing petAI record from PetAI_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ DeletePetRecordByID()

bool CKidsDBProvider::DeletePetRecordByID ( int  ID)

delete the existing pet record from Pet_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ DeletePuzzleRecordByID()

bool CKidsDBProvider::DeletePuzzleRecordByID ( int  ID)

delete the existing puzzle record from Puzzle_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ DeleteQuestRecordByID()

bool CKidsDBProvider::DeleteQuestRecordByID ( int  ID)

delete the existing quest record from Quest_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ DeleteTitleRecordByID()

bool CKidsDBProvider::DeleteTitleRecordByID ( int  ID)

delete the existing title record from Title_DB

Parameters
IDID of target record
Returns
true if the record is deleted in database

§ GetStringbyID()

string CKidsDBProvider::GetStringbyID ( int  ID)
static

Get string from ID.

Parameters
IDID in kids db's string table.
Returns
string in the current game language

§ InsertCharacterRecordFromString()

bool CKidsDBProvider::InsertCharacterRecordFromString ( const string &  strRecord)

Insert the new character record to Character_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ InsertChestRecordFromString()

bool CKidsDBProvider::InsertChestRecordFromString ( const string &  strRecord)

Insert the new chest record to Chest_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ InsertFruitRecordFromString()

bool CKidsDBProvider::InsertFruitRecordFromString ( const string &  strRecord)

Insert the new fruit record to Fruit_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ InsertItemRecordFromString()

bool CKidsDBProvider::InsertItemRecordFromString ( const string &  strRecord)

Insert the new item record to Item_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ InsertPetAIRecordFromString()

bool CKidsDBProvider::InsertPetAIRecordFromString ( const string &  strRecord)

Insert the new petAI record to PetAI_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ InsertPetRecordFromString()

bool CKidsDBProvider::InsertPetRecordFromString ( const string &  strRecord)

Insert the new pet record to Pet_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ InsertPuzzleRecordFromString()

bool CKidsDBProvider::InsertPuzzleRecordFromString ( const string &  strRecord)

Insert the new puzzle record to Puzzle_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ InsertQuestRecordFromString()

bool CKidsDBProvider::InsertQuestRecordFromString ( const string &  strRecord)

Insert the new quest record to Quest_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ InsertString()

int CKidsDBProvider::InsertString ( const char *  strEN,
const char *  strCN 
)
static

Insert the new string table entry to StringTable_DB.

Parameters
strEntry in the current game language
Returns
ID of the inserted string

§ InsertTitleRecordFromString()

bool CKidsDBProvider::InsertTitleRecordFromString ( const string &  strRecord)

Insert the new title record to Title_DB.

Parameters
recordID of record will be ignored and filled with actual ID if inserted successfully
Returns
true if the record is inserted in database

§ IsValid()

bool ParaEngine::CKidsDBProvider::IsValid ( )
inline

whether db is opened.

§ SelectItemRecordToString()

const char * CKidsDBProvider::SelectItemRecordToString ( __int64  ID)

Select existing item record of Item_DB.

Parameters
recordselect record by ID
Returns
true if the record is selected in database

§ SetDBEntity()

void CKidsDBProvider::SetDBEntity ( const string &  sConnectionstring)

replace the current database with current one.

the old one is closed and the new once will be opened.

Parameters
sConnectionstringthe file path

§ UpdateItemRecordFromString()

bool CKidsDBProvider::UpdateItemRecordFromString ( const string &  strRecord)

Update existing item record of Item_DB.

Parameters
strRecordupdate record with actual ID
Returns
true if the record is updated in database

§ ValidateDatabase()

void ParaEngine::CKidsDBProvider::ValidateDatabase ( )
inline

ensure that the database has been set up properly.

If not, ResetDatabase() is called to reset the database to blank


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