#ifndef GAME_H #define GAME_H #include #include #include #include #include "map.h" #include "world.h" class Entity; struct GLFWwindow; struct Savefile { const Map* map; std::pair position; }; class Game { public: Game(const char* maps); void execute(GLFWwindow* window); void loadMap(const Map& map, std::pair position); void detectCollision(Entity& collider, std::pair old_position); void saveGame(); void schedule(double time, std::function callback); void playerDie(); const World& getWorld() const; private: friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); std::list> entities; std::list> nextEntities; std::pair nextPosition; bool newWorld; std::shared_ptr player; const Map* currentMap; Savefile save; std::list>> scheduled; bool shouldQuit = false; World world; }; #endif