Unify selection ControllerStates so they can work on either background or editable...
[potlatch2.git] / net / systemeD / halcyon / Map.as
index 1377d4460fae730147afcf1d013bdae53e9b2964..8a45b074955be43ec35add9863ce76306e8dccca 100644 (file)
@@ -291,6 +291,14 @@ package net.systemeD.halcyon {
                        return editableLayer;
                }
 
+               /** Find which paint object an entity will be displayed on. */
+               public function getLayerForEntity(entity:Entity):MapPaint {
+                       for (var i:uint=0; i<paintContainer.numChildren; i++) {
+                               if (getLayerAt(i).sameConnection(entity)) return getLayerAt(i);
+                       }
+                       return null;
+               }
+
                // ------------------------------------------------------------------------------------------
                // Redraw all items, zoom in and out