commit:854b161e8250eaff04613529d07e402187161854
author:Chip Black
committer:Chip Black
date:Sun Oct 28 02:04:19 2018 -0500
parents:9ba078f713b5a834ae1baa5e7c44691121ec30c0
Remove global state object uniqueness
diff --git a/src/cell.ts b/src/cell.ts
line changes: +2/-8
index ae8dcfb..0a3ecad
--- a/src/cell.ts
+++ b/src/cell.ts
@@ -57,22 +57,16 @@ export class Cell extends Storable {
 
     addObject(o: GameObject) {
         // ensure that this object is not already in the gamestate
-        if (gs.objects.has(o.id)) {
-            throw new Error('Object already in gamestate: ' +  o.id)
+        if (this.objects.has(o.id)) {
+            throw new Error('Object already in cell: ' +  o.id)
         }
-        gs.objects.set(o.id, o);
-
         this.objects.set(o.id, o);
-        o.x = this.x;
-        o.y = this.y;
     }
 
     removeObject(o: GameObject) {
         if (this.objects.has(o.id)) {
             this.objects.delete(o.id);
-            o.x = o.y = undefined;
         }
-        gs.objects.delete(o.id);
     }
 
     store() {