Expose SimPersistID to EngineAPI

This commit is contained in:
Lukas Joergensen 2019-08-03 15:04:38 +02:00 committed by Lukas Aldershaab
parent fe09d6e125
commit e95a5bf139
2 changed files with 39 additions and 12 deletions

View file

@ -24,16 +24,26 @@
#include "console/simObject.h"
#include "core/util/tDictionary.h"
#include "core/util/safeDelete.h"
#include "engineAPI.h"
//#define DEBUG_SPEW
IMPLEMENT_CLASS(SimPersistID, "")
END_IMPLEMENT_CLASS;
SimPersistID::LookupTableType* SimPersistID::smLookupTable;
//-----------------------------------------------------------------------------
SimPersistID::SimPersistID()
{
mObject = NULL;
mUUID.generate();
smLookupTable->insertUnique(mUUID, this);
}
SimPersistID::SimPersistID( SimObject* object )
: mObject( object )
{
@ -136,3 +146,13 @@ SimPersistID* SimPersistID::findOrCreate( const Torque::UUID& uuid )
return pid;
}
DefineNewEngineMethod(SimPersistID, getUUID, Torque::UUID, (), , "")
{
return object->getUUID();
}
DefineNewEngineMethod(SimPersistID, getObject, SimObject*, (), , "")
{
return object->getObject();
}