change relation.appendMember to use the undo system, and update various places as...
[potlatch2.git] / net / systemeD / halcyon / connection / Relation.as
index 46688b0c39a9fc58178d3a64dd70280011eea1f0..4d0d6cbc2b3aaa490edfe09043ac2f08f3634e36 100644 (file)
@@ -79,13 +79,9 @@ package net.systemeD.halcyon.connection {
             performAction(new AddMemberToRelationAction(this, index, member, members));
         }
 
-        public function appendMember(member:RelationMember):uint {
-            members.push(member);
-                       member.entity.addParent(this);
-                       markDirty();
-
-                       dispatchEvent(new RelationMemberEvent(Connection.RELATION_MEMBER_ADDED, member.entity, this, members.length-1));
-            return members.length;
+        public function appendMember(member:RelationMember, performAction:Function):uint {
+            performAction(new AddMemberToRelationAction(this, -1, member, members));
+            return members.length + 1;
         }
 
                public function removeMember(entity:Entity, performAction:Function):void {