diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-09 18:27:03 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-09 18:27:03 -0500 |
commit | 9510e4fbbe817ab62ce014ee50283edd62fa00d9 (patch) | |
tree | 7d3562c7f9a15ea276642712718a83b0a6634add /src/map.h | |
parent | c85f91cc5e0f9e94717fbc36ebef3b2637986121 (diff) | |
download | tanetane-9510e4fbbe817ab62ce014ee50283edd62fa00d9.tar.gz tanetane-9510e4fbbe817ab62ce014ee50283edd62fa00d9.tar.bz2 tanetane-9510e4fbbe817ab62ce014ee50283edd62fa00d9.zip |
Entity prototypes can be stored in the map file now
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/map.h b/src/map.h index de18e68..a896b00 100644 --- a/src/map.h +++ b/src/map.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef MAP_H_D95D6D47 | 1 | #ifndef MAP_H_D95D6D47 |
2 | #define MAP_H_D95D6D47 | 2 | #define MAP_H_D95D6D47 |
3 | 3 | ||
4 | #include <string> | ||
4 | #include <string_view> | 5 | #include <string_view> |
5 | #include <vector> | 6 | #include <vector> |
6 | #include "renderer.h" | 7 | #include "renderer.h" |
@@ -17,6 +18,15 @@ struct Tile { | |||
17 | StepType step = StepType::none; | 18 | StepType step = StepType::none; |
18 | }; | 19 | }; |
19 | 20 | ||
21 | struct Prototype { | ||
22 | std::string name; | ||
23 | vec2i pos; | ||
24 | vec2i collisionOffset; | ||
25 | vec2i collisionSize; | ||
26 | std::string animationFilename; | ||
27 | std::string interactionScript; | ||
28 | }; | ||
29 | |||
20 | class Map { | 30 | class Map { |
21 | public: | 31 | public: |
22 | 32 | ||
@@ -36,6 +46,8 @@ public: | |||
36 | 46 | ||
37 | StepType getStepType(int x, int y) const; | 47 | StepType getStepType(int x, int y) const; |
38 | 48 | ||
49 | const std::vector<Prototype>& getPrototypes() const { return prototypes_; } | ||
50 | |||
39 | private: | 51 | private: |
40 | 52 | ||
41 | vec2i mapSize_; | 53 | vec2i mapSize_; |
@@ -43,6 +55,7 @@ private: | |||
43 | std::vector<std::vector<Tile>> layers_; | 55 | std::vector<std::vector<Tile>> layers_; |
44 | int tilesetTextureId_; | 56 | int tilesetTextureId_; |
45 | int tilesetColumns_; | 57 | int tilesetColumns_; |
58 | std::vector<Prototype> prototypes_; | ||
46 | }; | 59 | }; |
47 | 60 | ||
48 | #endif /* end of include guard: MAP_H_D95D6D47 */ | 61 | #endif /* end of include guard: MAP_H_D95D6D47 */ |