summary refs log tree commit diff stats
path: root/src/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/game.h b/src/game.h index 3f0fcc8..dd4b2f7 100644 --- a/src/game.h +++ b/src/game.h
@@ -6,6 +6,7 @@
6#include <list> 6#include <list>
7#include <map> 7#include <map>
8#include "map.h" 8#include "map.h"
9#include "world.h"
9 10
10class Entity; 11class Entity;
11struct GLFWwindow; 12struct GLFWwindow;
@@ -24,14 +25,11 @@ class Game {
24 void saveGame(); 25 void saveGame();
25 void schedule(double time, std::function<void ()> callback); 26 void schedule(double time, std::function<void ()> callback);
26 void playerDie(); 27 void playerDie();
27 const Map& getMap(int id) const; 28 const World& getWorld() const;
28 29
29 private: 30 private:
30 friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); 31 friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
31 32
32 std::map<int, Map> maps;
33 int startMap;
34 std::pair<int, int> startPos;
35 std::list<std::shared_ptr<Entity>> entities; 33 std::list<std::shared_ptr<Entity>> entities;
36 std::list<std::shared_ptr<Entity>> nextEntities; 34 std::list<std::shared_ptr<Entity>> nextEntities;
37 std::pair<double, double> nextPosition; 35 std::pair<double, double> nextPosition;
@@ -41,6 +39,7 @@ class Game {
41 Savefile save; 39 Savefile save;
42 std::list<std::pair<double, std::function<void ()>>> scheduled; 40 std::list<std::pair<double, std::function<void ()>>> scheduled;
43 bool shouldQuit = false; 41 bool shouldQuit = false;
42 World world;
44}; 43};
45 44
46#endif 45#endif