Updated awareness/observers and deprecated addObject/removeObject

This commit is contained in:
Obique PSWG
2016-05-18 21:08:43 -05:00
parent 201fc03cf3
commit 381635895f
12 changed files with 172 additions and 196 deletions
+4 -9
View File
@@ -150,13 +150,10 @@ public class ObjectManager extends Manager {
if (obj.getParent() != null) {
if (!obj.getParent().isGenerated()) {
long id = obj.getParent().getObjectId();
obj.getParent().removeObject(obj);
SWGObject parent = getObjectById(id);
if (parent != null)
parent.addObject(obj);
else {
obj.moveToContainer(parent);
if (parent == null)
Log.e("ObjectManager", "Parent for %s is null! ParentID: %d", obj, id);
}
} else {
updateBuildoutParent(obj.getParent());
}
@@ -313,7 +310,7 @@ public class ObjectManager extends Manager {
}
object.sendObserversAndSelf(new SceneDestroyObject(objId));
parent.removeObject(object);
object.moveToContainer(null);
} else {
object.sendObservers(new SceneDestroyObject(objId));
}
@@ -355,9 +352,7 @@ public class ObjectManager extends Manager {
return null;
}
obj.setLocation(l);
if (parent != null) {
parent.addObject(obj);
}
obj.moveToContainer(parent);
synchronized (database) {
if (addToDatabase) {
database.put(obj.getObjectId(), obj);