generic parent object handling
[potlatch2.git] / net / systemeD / halcyon / connection / Way.as
index ef5ee400e224cd7fe7e4b6eaf727734372b67a6a..56dad5f6f8066222c25aa42bf334b09c75a12b85 100644 (file)
@@ -7,8 +7,7 @@ package net.systemeD.halcyon.connection {
         public function Way(id:Number, version:uint, tags:Object, nodes:Array) {
             super(id, version, tags);
             this.nodes = nodes;
-            for each(var node:Node in nodes)
-                node.registerAddedToWay(this);
+                       for each (var node:Node in nodes) { node.addParent(this); }
         }
 
         public function get length():uint {
@@ -20,19 +19,19 @@ package net.systemeD.halcyon.connection {
         }
 
         public function insertNode(index:uint, node:Node):void {
+                       node.addParent(this);
             nodes.splice(index, 0, node);
-            node.registerAddedToWay(this);
         }
 
         public function appendNode(node:Node):uint {
+                       node.addParent(this);
             nodes.push(node);
-            node.registerAddedToWay(this);
             return nodes.length;
         }
 
         public function removeNode(index:uint):void {
-            var splicedNodes:Array = nodes.splice(index, 1);
-            splicedNodes[0].registerRemovedFromWay(this);
+            var removed:Array=nodes.splice(index, 1);
+                       removed[0].removeParent(this);
         }
 
         public override function toString():String {