summary refs log tree commit diff stats
path: root/src/game.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2015-06-11 11:38:49 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2015-06-11 11:38:49 -0400
commit879c2c04d9c3879f871cfe79f9b25fd23c5184b4 (patch)
tree70bf8773b18478af58ecd0877b6bb62a7279c094 /src/game.h
parent11f4af82626b0e35c35606b327e4181c7c88f228 (diff)
downloadtherapy-879c2c04d9c3879f871cfe79f9b25fd23c5184b4.tar.gz
therapy-879c2c04d9c3879f871cfe79f9b25fd23c5184b4.tar.bz2
therapy-879c2c04d9c3879f871cfe79f9b25fd23c5184b4.zip
Wrote EntityManager
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/game.h b/src/game.h deleted file mode 100644 index dd4b2f7..0000000 --- a/src/game.h +++ /dev/null
@@ -1,45 +0,0 @@
1#ifndef GAME_H
2#define GAME_H
3
4#include <memory>
5#include <functional>
6#include <list>
7#include <map>
8#include "map.h"
9#include "world.h"
10
11class Entity;
12struct GLFWwindow;
13
14struct Savefile {
15 const Map* map;
16 std::pair<double, double> position;
17};
18
19class Game {
20 public:
21 Game(const char* maps);
22 void execute(GLFWwindow* window);
23 void loadMap(const Map& map, std::pair<double, double> position);
24 void detectCollision(Entity& collider, std::pair<double, double> old_position);
25 void saveGame();
26 void schedule(double time, std::function<void ()> callback);
27 void playerDie();
28 const World& getWorld() const;
29
30 private:
31 friend void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);
32
33 std::list<std::shared_ptr<Entity>> entities;
34 std::list<std::shared_ptr<Entity>> nextEntities;
35 std::pair<double, double> nextPosition;
36 bool newWorld;
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;
42 World world;
43};
44
45#endif