private fun removeUnusedTilesets(map: Map<*, *>) { val sets: MutableIterator<*> = map.getTileSets().iterator() while (sets.hasNext()) { val tileset: TileSet = sets.next() as TileSet if (!isUsedTileset(map, tileset)) { sets.remove() } } }
Remove any tilesets in a map that are not actually in use .