diff options
Diffstat (limited to 'src/game.h')
| -rw-r--r-- | src/game.h | 51 |
1 files changed, 15 insertions, 36 deletions
| diff --git a/src/game.h b/src/game.h index dd4b2f7..3822700 100644 --- a/src/game.h +++ b/src/game.h | |||
| @@ -1,45 +1,24 @@ | |||
| 1 | #ifndef GAME_H | 1 | #ifndef GAME_H_1014DDC9 |
| 2 | #define GAME_H | 2 | #define GAME_H_1014DDC9 |
| 3 | 3 | ||
| 4 | #include <memory> | 4 | #include "renderer.h" |
| 5 | #include <functional> | 5 | #include "entity_manager.h" |
| 6 | #include <list> | 6 | #include "system_manager.h" |
| 7 | #include <map> | ||
| 8 | #include "map.h" | ||
| 9 | #include "world.h" | ||
| 10 | |||
| 11 | class Entity; | ||
| 12 | struct GLFWwindow; | ||
| 13 | |||
| 14 | struct Savefile { | ||
| 15 | const Map* map; | ||
| 16 | std::pair<double, double> position; | ||
| 17 | }; | ||
| 18 | 7 | ||
| 19 | class Game { | 8 | class Game { |
| 20 | public: | 9 | public: |
| 21 | Game(const char* maps); | 10 | Game(GLFWwindow* window); |
| 22 | void execute(GLFWwindow* window); | 11 | |
| 23 | void loadMap(const Map& map, std::pair<double, double> position); | 12 | void execute(); |
| 24 | void detectCollision(Entity& collider, std::pair<double, double> old_position); | 13 | EntityManager& getEntityManager(); |
| 25 | void saveGame(); | ||
| 26 | void schedule(double time, std::function<void ()> callback); | ||
| 27 | void playerDie(); | ||
| 28 | const World& getWorld() const; | ||
| 29 | 14 | ||
| 30 | private: | ||
| 31 | friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); | 15 | friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); |
| 32 | 16 | ||
| 33 | std::list<std::shared_ptr<Entity>> entities; | 17 | private: |
| 34 | std::list<std::shared_ptr<Entity>> nextEntities; | 18 | EntityManager entityManager; |
| 35 | std::pair<double, double> nextPosition; | 19 | SystemManager systemManager; |
| 36 | bool newWorld; | 20 | GLFWwindow* const window; |
| 37 | std::shared_ptr<Entity> player; | ||
| 38 | const Map* currentMap; | ||
| 39 | Savefile save; | ||
| 40 | std::list<std::pair<double, std::function<void ()>>> scheduled; | ||
| 41 | bool shouldQuit = false; | 21 | bool shouldQuit = false; |
| 42 | World world; | ||
| 43 | }; | 22 | }; |
| 44 | 23 | ||
| 45 | #endif | 24 | #endif /* end of include guard: GAME_H_1014DDC9 */ |
