aboutsummaryrefslogtreecommitdiff
path: root/src/lua/common/je_lua_object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/common/je_lua_object.cpp')
-rw-r--r--src/lua/common/je_lua_object.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lua/common/je_lua_object.cpp b/src/lua/common/je_lua_object.cpp
index 9aabeb5..c35356e 100644
--- a/src/lua/common/je_lua_object.cpp
+++ b/src/lua/common/je_lua_object.cpp
@@ -12,7 +12,7 @@ namespace JinEngine
{
shared = obj;
shared->retain();
- dependencies = new std::map<uint, Shared*>();
+ dependencies = new std::map<uint, LuaObject*>();
}
}
@@ -35,7 +35,7 @@ namespace JinEngine
const char* LuaObject::getObjectType()
{
- return shared->getType();
+ return type;
}
Shared* LuaObject::getShared()
@@ -43,11 +43,11 @@ namespace JinEngine
return shared;
}
- void LuaObject::setDependency(uint key, Shared* dep)
+ void LuaObject::setDependency(uint key, LuaObject* dep)
{
removeDependency(key);
- dependencies->insert(std::pair<uint, Shared*>(key, dep));
- luax_addreference(state, shared, dep);
+ dependencies->insert(std::pair<uint, LuaObject*>(key, dep));
+ luax_addreference(state, this, dep);
}
void LuaObject::removeDependency(uint key)
@@ -55,19 +55,19 @@ namespace JinEngine
if (!isDependOn(key))
return;
DepsMap::iterator it = dependencies->find(key);
- Shared* dep = it->second;
- luax_removereference(state, shared, dep);
+ LuaObject* dep = it->second;
+ luax_removereference(state, this, dep);
dependencies->erase(it);
}
- void LuaObject::removeDependency(Shared* dependency)
+ void LuaObject::removeDependency(LuaObject* dependency)
{
for (DepsMap::iterator it = dependencies->begin(); it != dependencies->end();)
{
- Shared* dep = it->second;
+ LuaObject* dep = it->second;
if (dep == dependency)
{
- luax_removereference(state, shared, dep);
+ luax_removereference(state, this, dep);
dependencies->erase(it);
}
else
@@ -80,9 +80,9 @@ namespace JinEngine
return dependencies->find(key) != dependencies->end();
}
- bool LuaObject::isDependOn(Shared* shared)
+ bool LuaObject::isDependOn(LuaObject* shared)
{
- for (std::pair<uint, Shared*> dep : (*dependencies))
+ for (std::pair<uint, LuaObject*> dep : (*dependencies))
{
if (dep.second == shared)
return true;
@@ -92,11 +92,11 @@ namespace JinEngine
void LuaObject::clearDependencies()
{
- luax_removereference(state, shared);
+ luax_removereference(state, this);
dependencies->clear();
}
- Shared* LuaObject::getDependency(uint key)
+ LuaObject* LuaObject::getDependency(uint key)
{
if (!isDependOn(key))
return nullptr;