multipolygons shouldn't have non-Way members
[potlatch2.git] / net / systemeD / halcyon / connection / Relation.as
index ea8902ad1d5973928e9c2c94d4ed616d94602c4c..8ac31927f11b97ab1a6c9a8b0035c292a1fdbcc0 100644 (file)
@@ -60,10 +60,10 @@ package net.systemeD.halcyon.connection {
                        markDirty();
         }
 
-               public function findMembersByRole(role:String):Array {
+               public function findMembersByRole(role:String, entityType:Class=null):Array {
                        var a:Array=[];
             for (var index:uint = 0; index < members.length; index++) {
-                if (members[index].role==role) { a.push(members[index].entity); }
+                if (members[index].role==role && (!entityType || members[index].entity is entityType)) { a.push(members[index].entity); }
             }
                        return a;
                }