forEachLayer

inline fun <T : MapLayer> TiledMap.forEachLayer(action: (T) -> Unit)

Extension method to run an action on a specific type of layers of the TiledMap. The lambda takes the matching MapLayer as a parameter.

The class matching is an exact match meaning that a given subclass like TiledMapTileLayer will not match for the argument MapLayer.