X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fworldmap%2Fworldmap.hpp;h=c42e5510bd529d421bb23d58608cddc18386991b;hb=5c7020e504303cf18e472283ab614ef08ad43b2c;hp=b0e56acd0291ff3c38ac38c780d04cdb797e66a3;hpb=a52595afbb418f560e9a23ef59e0fb7661d2d995;p=supertux.git diff --git a/src/worldmap/worldmap.hpp b/src/worldmap/worldmap.hpp index b0e56acd0..c42e5510b 100644 --- a/src/worldmap/worldmap.hpp +++ b/src/worldmap/worldmap.hpp @@ -22,15 +22,16 @@ #include #include "control/controller.hpp" -#include "util/reader_fwd.hpp" #include "math/vector.hpp" #include "supertux/console.hpp" #include "supertux/game_object.hpp" +#include "supertux/game_object_ptr.hpp" #include "supertux/level.hpp" #include "supertux/screen.hpp" #include "supertux/statistics.hpp" #include "supertux/tile_manager.hpp" #include "supertux/timer.hpp" +#include "util/reader_fwd.hpp" #include "worldmap/direction.hpp" #include "worldmap/spawn_point.hpp" #include "worldmap/special_tile.hpp" @@ -73,10 +74,10 @@ private: typedef std::vector SpriteChanges; typedef std::vector SpawnPoints; typedef std::vector LevelTiles; - typedef std::vector GameObjects; + typedef std::vector GameObjects; typedef std::vector ScriptList; - Tux* tux; + std::shared_ptr tux; Savegame& m_savegame; @@ -127,10 +128,10 @@ public: WorldMap(const std::string& filename, Savegame& savegame, const std::string& force_spawnpoint = ""); ~WorldMap(); - void add_object(GameObject* object); + void add_object(GameObjectPtr object); - void try_expose(GameObject* object); - void try_unexpose(GameObject* object); + void try_expose(const GameObjectPtr& object); + void try_unexpose(const GameObjectPtr& object); static WorldMap* current() { return current_; } @@ -167,7 +168,7 @@ public: void finished_level(Level* level); /** returns current Tux incarnation */ - Tux* get_tux() { return tux; } + Tux* get_tux() { return tux.get(); } Savegame& get_savegame() { return m_savegame; }