diff options
Diffstat (limited to 'src/map.h')
| -rw-r--r-- | src/map.h | 41 |
1 files changed, 41 insertions, 0 deletions
| diff --git a/src/map.h b/src/map.h new file mode 100644 index 0000000..1031996 --- /dev/null +++ b/src/map.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #ifndef MAP_H_D95D6D47 | ||
| 2 | #define MAP_H_D95D6D47 | ||
| 3 | |||
| 4 | #include <string_view> | ||
| 5 | #include <vector> | ||
| 6 | #include "renderer.h" | ||
| 7 | #include "vector.h" | ||
| 8 | |||
| 9 | class Renderer; | ||
| 10 | |||
| 11 | struct Tile { | ||
| 12 | unsigned int id = 0; | ||
| 13 | bool flipHorizontal = false; | ||
| 14 | bool flipVertical = false; | ||
| 15 | }; | ||
| 16 | |||
| 17 | class Map { | ||
| 18 | public: | ||
| 19 | |||
| 20 | Map(std::string_view filename, Renderer& renderer); | ||
| 21 | |||
| 22 | const vec2i& getMapSize() const { return mapSize_; } | ||
| 23 | |||
| 24 | const vec2i& getTileSize() const { return tileSize_; } | ||
| 25 | |||
| 26 | const std::vector<std::vector<Tile>>& getLayers() const { return layers_; } | ||
| 27 | |||
| 28 | int getTilesetTextureId() const { return tilesetTextureId_; } | ||
| 29 | |||
| 30 | int getTilesetColumns() const { return tilesetColumns_; } | ||
| 31 | |||
| 32 | private: | ||
| 33 | |||
| 34 | vec2i mapSize_; | ||
| 35 | vec2i tileSize_; | ||
| 36 | std::vector<std::vector<Tile>> layers_; | ||
| 37 | int tilesetTextureId_; | ||
| 38 | int tilesetColumns_; | ||
| 39 | }; | ||
| 40 | |||
| 41 | #endif /* end of include guard: MAP_H_D95D6D47 */ | ||
