Public Member Functions | |
bool | IsValid () |
check if the object is valid | |
ParaDataProvider (void *pObj) | |
bool | InsertPuzzleRecordFromString (const char *strRecord) |
Insert the new puzzle record to Puzzle_DB. | |
bool | DeletePuzzleRecordByID (int ID) |
delete the existing puzzle record from Puzzle_DB | |
int | GetNPCIDByName (const char *name) |
get NPC ID by name | |
int | GetNPCCount () |
the total number of NPC in the database. | |
bool | DoesAttributeExists (const char *sName) |
whether a given attribute exists. | |
object | GetAttribute (const char *sName, const object &sOut) |
get the attribute of the current attribute instance in the current table e.g. | |
bool | UpdateAttribute (const char *sName, const object &sIn) |
update the attribute of the current attribute instance in the current table insert the attribute if it is not created before. | |
bool | InsertAttribute (const char *sName, const object &sIn) |
insert by simple name value pair | |
bool | DeleteAttribute (const char *sName) |
delete the attribute of the current attribute instance in the current table | |
void | SetTableName (const char *sName) |
set current attribute table name, the table will be created if not exists. | |
const char * | GetTableName () |
get the current attribute table name | |
Static Public Member Functions | |
static void | GetKidsDBProvider (ParaKidsDataProvider *pOut) |
Public Attributes | |
union { | |
void * m_pDataProvider | |
CCharacterDB * m_pDbCharacter | |
CKidsDBProvider * m_pDbKidsProvider | |
CNpcDatabase * m_pDbNPC | |
AttributeProvider * m_pAttributeProvider | |
}; |
bool ParaScripting::ParaDataProvider::InsertPuzzleRecordFromString | ( | const char * | strRecord | ) |
Insert the new puzzle record to Puzzle_DB.
record,: | ID of record will be ignored and filled with actual ID if inserted successfully |
bool ParaScripting::ParaDataProvider::DeletePuzzleRecordByID | ( | int | ID | ) |
delete the existing puzzle record from Puzzle_DB
ID,: | ID of target record |
int ParaScripting::ParaDataProvider::GetNPCIDByName | ( | const char * | name | ) |
get NPC ID by name
name | name of character |
int ParaScripting::ParaDataProvider::GetNPCCount | ( | ) |
the total number of NPC in the database.
There is no statement cached for this call.
bool ParaScripting::ParaDataProvider::DoesAttributeExists | ( | const char * | sName | ) |
whether a given attribute exists.
This function is usually used internally. One common use of this function is to test if a field exists, so that we know if a object has been saved before or not.
sName | : name of the attribute field |
object ParaScripting::ParaDataProvider::GetAttribute | ( | const char * | sName, | |
const object & | sOut | |||
) |
get the attribute of the current attribute instance in the current table e.g.
suppose db is a ParaDataProvider object. local x = db:GetAttribute("PlayerX", 0); local name = db:GetAttribute("PlayerName", "no_name");
sName | : name of the attribute field | |
sOut | : [in|out] default value of the field. Currently it may be a string or a number |
bool ParaScripting::ParaDataProvider::UpdateAttribute | ( | const char * | sName, | |
const object & | sIn | |||
) |
update the attribute of the current attribute instance in the current table insert the attribute if it is not created before.
sName | : name of the attribute field | |
sIn,: | value of the attribute field. Currently it may be a string, boolean or a number. |
bool ParaScripting::ParaDataProvider::InsertAttribute | ( | const char * | sName, | |
const object & | sIn | |||
) |
insert by simple name value pair
sName | : name of the attribute field | |
sIn,: | value of the attribute field. Currently it may be a string, boolean or a number. |
bool ParaScripting::ParaDataProvider::DeleteAttribute | ( | const char * | sName | ) |
delete the attribute of the current attribute instance in the current table
sName | : name of the attribute field |
void ParaScripting::ParaDataProvider::SetTableName | ( | const char * | sName | ) |
set current attribute table name, the table will be created if not exists.
sName | table name |
const char* ParaScripting::ParaDataProvider::GetTableName | ( | ) |
get the current attribute table name