From 0e0389752a0912614737e5c059b5cd4719ef9cf2 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 10 Mar 2015 19:42:04 -0400 Subject: Const correctness! Also created savefile and refactored collisions a bit. --- src/game.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/game.h') diff --git a/src/game.h b/src/game.h index c419c5d..69b8df7 100644 --- a/src/game.h +++ b/src/game.h @@ -17,12 +17,19 @@ const int MAP_HEIGHT = GAME_HEIGHT/TILE_HEIGHT; const int FRAMES_PER_SECOND = 60; const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND; +struct Savefile { + const Map* map; + std::pair position; +}; + class Game { public: Game(); void execute(GLFWwindow* window); - void loadMap(Map& map); + void loadMap(const Map& map); void detectCollision(Entity& collider, std::pair old_position); + void saveGame(const Map& map, std::pair position); + void loadGame(const Map& curMap); bool shouldQuit = false; private: @@ -34,6 +41,7 @@ class Game { std::shared_ptr player; Map m{"../maps/embarass.txt"}; Map m2{"../maps/second.txt"}; + Savefile save; }; #endif -- cgit 1.4.1