/** * Find a tile for a given global tile id * * @param gid The global tile id we're looking for * @return The tileset in which that tile lives or null if the gid is not defined */ public TileSet findTileSet(int gid) { for (int i = 0; i < tileSets.size(); i++) { TileSet set = (TileSet) tileSets.get(i); if (set.contains(gid)) { return set; } } return null; }