Wrapper of internal ParaWorld data provider.
More...
#include <ParaScriptingWorld.h>
Wrapper of internal ParaWorld data provider.
§ DeleteAttribute()
bool ParaDataProvider::DeleteAttribute |
( |
const char * |
sName | ) |
|
delete the attribute of the current attribute instance in the current table
- Parameters
-
sName | : name of the attribute field |
- Returns
- true if succeed.
§ DeletePuzzleRecordByID()
bool ParaDataProvider::DeletePuzzleRecordByID |
( |
int |
ID | ) |
|
delete the existing puzzle record from Puzzle_DB
- Parameters
-
- Returns
- true if the record is deleted in database
§ DoesAttributeExists()
bool 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.
- Parameters
-
sName | : name of the attribute field |
- Returns
§ ExecSQL()
bool ParaScripting::ParaDataProvider::ExecSQL |
( |
const char * |
sCmd | ) |
|
run a given sql command, commonly used commands are "BEGIN", "END", when we are batch saving attributes.
§ GetAttribute()
object 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");
- Parameters
-
sName | : name of the attribute field |
sOut | : [in|out] default value of the field. Currently it may be a string or a number |
- Returns
- the object is returned. Currently it may be a string, boolean or a number.
§ GetNPCCount()
int ParaDataProvider::GetNPCCount |
( |
| ) |
|
the total number of NPC in the database.
There is no statement cached for this call.
- Returns
§ GetNPCIDByName()
int ParaDataProvider::GetNPCIDByName |
( |
const char * |
name | ) |
|
get NPC ID by name
- Parameters
-
- Returns
- id is returned if found in database; otherwise non-positive value(-1) is returned.
§ GetTableName()
const char * ParaDataProvider::GetTableName |
( |
| ) |
|
get the current attribute table name
- Returns
- current attribute table name
§ InsertAttribute()
bool ParaDataProvider::InsertAttribute |
( |
const char * |
sName, |
|
|
const object & |
sIn |
|
) |
| |
insert by simple name value pair
- Parameters
-
sName | : name of the attribute field |
sIn | value of the attribute field. Currently it may be a string, boolean or a number. |
- Returns
- true if succeed.
§ InsertPuzzleRecordFromString()
bool ParaDataProvider::InsertPuzzleRecordFromString |
( |
const char * |
strRecord | ) |
|
Insert the new puzzle record to Puzzle_DB.
- Parameters
-
record | ID of record will be ignored and filled with actual ID if inserted successfully |
- Returns
- true if the record is inserted in database
§ SetTableName()
void ParaDataProvider::SetTableName |
( |
const char * |
sName | ) |
|
set current attribute table name, the table will be created if not exists.
- Parameters
-
§ UpdateAttribute()
bool 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.
- Parameters
-
sName | : name of the attribute field |
sIn | value of the attribute field. Currently it may be a string, boolean or a number. |
- Returns
- true if succeed.
The documentation for this class was generated from the following files:
- Client/trunk/ParaEngineClient/ParaScriptBindings/ParaScriptingWorld.h
- Client/trunk/ParaEngineClient/ParaScriptBindings/ParaScriptingWorld.cpp