summary refs log tree commit diff stats
path: root/src/map.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-09 20:34:59 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-09 20:34:59 -0500
commit315ca2fb388f790791c9ce372cf44e00d51e0e7f (patch)
tree99fd0a66ce191959c73fe5058e538a4dcd07100e /src/map.h
parent0c2cd251fa0427b19f7c995bc7da7319d2ac80a5 (diff)
downloadtanetane-315ca2fb388f790791c9ce372cf44e00d51e0e7f.tar.gz
tanetane-315ca2fb388f790791c9ce372cf44e00d51e0e7f.tar.bz2
tanetane-315ca2fb388f790791c9ce372cf44e00d51e0e7f.zip
Added trigger zones to the map
Walking into a trigger zone runs a script.
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map.h b/src/map.h index 7bfb15e..4c5d6d4 100644 --- a/src/map.h +++ b/src/map.h
@@ -28,6 +28,13 @@ struct Prototype {
28 std::string interactionScript; 28 std::string interactionScript;
29}; 29};
30 30
31struct Trigger {
32 std::string name;
33 vec2i pos;
34 vec2i size;
35 std::string script;
36};
37
31class Map { 38class Map {
32public: 39public:
33 40
@@ -51,6 +58,8 @@ public:
51 58
52 const vec2i& getWarpPoint(const std::string& name) const { return warpPoints_.at(name); } 59 const vec2i& getWarpPoint(const std::string& name) const { return warpPoints_.at(name); }
53 60
61 const std::vector<Trigger>& getTriggers() const { return triggers_; }
62
54private: 63private:
55 64
56 vec2i mapSize_; 65 vec2i mapSize_;
@@ -60,6 +69,7 @@ private:
60 int tilesetColumns_; 69 int tilesetColumns_;
61 std::vector<Prototype> prototypes_; 70 std::vector<Prototype> prototypes_;
62 std::map<std::string, vec2i> warpPoints_; 71 std::map<std::string, vec2i> warpPoints_;
72 std::vector<Trigger> triggers_;
63}; 73};
64 74
65#endif /* end of include guard: MAP_H_D95D6D47 */ 75#endif /* end of include guard: MAP_H_D95D6D47 */