X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftile_manager.h;h=67c7512227c6779a7afe8b74b6f7e0e84c1c7c79;hb=9f43687076203b3769cd2b9a499d1fb57cd8c40f;hp=a72777b13e065974a629df4249f25b688cfa8d99;hpb=4768775a296265eea1afae5cf971b1706fc049fd;p=supertux.git diff --git a/src/tile_manager.h b/src/tile_manager.h index a72777b13..67c751222 100644 --- a/src/tile_manager.h +++ b/src/tile_manager.h @@ -24,6 +24,7 @@ #include #include #include +#include class Tile; @@ -44,7 +45,10 @@ class TileManager TileManager(); ~TileManager(); - std::vector tiles; +// std::vector tiles; + typedef std::map Tiles; + Tiles tiles; + static TileManager* instance_ ; static std::set* tilegroups_; void load_tileset(std::string filename); @@ -65,20 +69,7 @@ class TileManager unsigned int total_ids() { return tiles.size(); } - Tile& get(unsigned int id) { - - if(id < tiles.size()) - { - return *tiles[id]; - } - else - { - // Never return 0, but return the 0th tile instead so that - // user code doesn't have to check for NULL pointers all over - // the place - return *tiles[0]; - } - } + Tile* get(unsigned int id); }; #endif