Add CreatePropList script function

Is this needed?
Günther Brammer 2009-05-20 00:32:01 +02:00
parent bf839b9a66
commit 79f8d5496a
3 changed files with 12 additions and 0 deletions

View File

@ -31,6 +31,7 @@ class C4PropList {
void ResetProperty(C4String * k);
C4PropList();
C4PropList(C4PropList * prototype);
virtual ~C4PropList();
protected:

View File

@ -34,6 +34,11 @@ C4PropList::C4PropList():
{
}
C4PropList::C4PropList(C4PropList * prototype):
FirstRef(NULL), prototype(prototype)
{
}
C4PropList::~C4PropList()
{
assert(!FirstRef);

View File

@ -964,6 +964,11 @@ static C4String *FnGetAction(C4AulContext *cthr, C4Object *pObj)
return String(pObj->Def->ActMap[pObj->Action.Act].Name);
}
static C4PropList * FnCreatePropList(C4AulContext *cthr, C4PropList * prototype)
{
return new C4PropList(prototype);
}
static C4Value FnGetProperty_C4V(C4AulContext *cthr, C4Value * key_C4V, C4Value * pObj_C4V)
{
C4PropList * pObj = pObj_C4V->_getPropList();
@ -6582,6 +6587,7 @@ void InitFunctionMap(C4AulScriptEngine *pEngine)
AddFunc(pEngine, "SetYDir", FnSetYDir);
AddFunc(pEngine, "SetR", FnSetR);
AddFunc(pEngine, "SetOwner", FnSetOwner);
AddFunc(pEngine, "CreatePropList", FnCreatePropList);
AddFunc(pEngine, "CreateObject", FnCreateObject);
AddFunc(pEngine, "MakeCrewMember", FnMakeCrewMember);
AddFunc(pEngine, "GrabObjectInfo", FnGrabObjectInfo);