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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game.h b/src/game.h index 274ef2e..e5976b1 100644 --- a/src/game.h +++ b/src/game.h
@@ -4,6 +4,7 @@
4#include <set> 4#include <set>
5#include <range/v3/all.hpp> 5#include <range/v3/all.hpp>
6#include <vector> 6#include <vector>
7#include <tileson.hpp>
7#include "sprite.h" 8#include "sprite.h"
8 9
9struct Input { 10struct Input {
@@ -54,10 +55,18 @@ public:
54 } 55 }
55 } 56 }
56 57
58 void loadMapFromFile(std::string_view filename) {
59 tson::Tileson t;
60 map_ = t.parse(fs::path(filename));
61 }
62
63 tson::Map* getMap() const { return map_.get(); }
64
57private: 65private:
58 66
59 std::vector<Sprite> sprites_; 67 std::vector<Sprite> sprites_;
60 std::set<std::tuple<int, int>> spritesByY_; 68 std::set<std::tuple<int, int>> spritesByY_;
69 std::unique_ptr<tson::Map> map_;
61}; 70};
62 71
63#endif /* end of include guard: GAME_H_E6F1396E */ 72#endif /* end of include guard: GAME_H_E6F1396E */