Platformer/Game/Source/Map.cpp
// L06: DONE 3: Pick the right Tileset based on a tile id
DONE 3: Pick the right Tileset based on a tile id
DONE 3 : Pick the right Tileset based on a tile id
TileSet* Map::GetTilesetFromTileId(int id) const
{
	ListItem<TileSet*>* item = data.tilesets.start;
	TileSet* set = item->data;
	while (item)
	{
		if (id < item->data->firstgid)
		{
			set = item->prev->data;
			break;
		}
		set = item->data;
		item = item->next;
	}
	return set;
}
TileSet * Map :: GetTilesetFromTileId ( int id ) const { ListItem < TileSet * > * item = data . tilesets . start ; TileSet * set = item -> data ; while ( item ) { if ( id < item -> data -> firstgid ) { set = item -> prev -> data ; break ; } set = item -> data ; item = item -> next ; } return set ; }
L06: DONE 3: Pick the right Tileset based on a tile id
L06 : DONE 3 : Pick the right Tileset based on a tile id