basic multipolygon rendering
[potlatch2.git] / net / systemeD / halcyon / connection / Relation.as
index dfa6b45b2098582097ef1070c5af328fa682faaf..5cab4047149e9046a8884735b8b5761e34f77b2d 100644 (file)
@@ -60,12 +60,16 @@ package net.systemeD.halcyon.connection {
                        markDirty();
         }
 
-        public function insertMember(index:uint, member:RelationMember):void {
-            members.splice(index, 0, member);
-                       member.entity.addParent(this);
-                       markDirty();
-                       
-                       dispatchEvent(new RelationMemberEvent(Connection.RELATION_MEMBER_ADDED, member.entity, this, index));
+               public function findMembersByRole(role:String):Array {
+                       var a:Array=[];
+            for (var index:uint = 0; index < members.length; index++) {
+                if (members[index].role==role) { a.push(members[index].entity); }
+            }
+                       return a;
+               }
+
+        public function insertMember(index:uint, member:RelationMember, performAction:Function):void {
+            performAction(new AddMemberToRelationAction(this, index, member, members));
         }
 
         public function appendMember(member:RelationMember):uint {