diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-27 17:40:26 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-27 17:40:26 -0500 |
commit | e03683852cac9b31ca846fcf13ff53abf99232c7 (patch) | |
tree | 4f18e4f6d033547f8bf9210ff8466406ed6dbd49 /src/behaviour_system.h | |
parent | 4be70b7d55493cdc2d5e909d5101e70a16bee6f1 (diff) | |
download | tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.tar.gz tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.tar.bz2 tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.zip |
Added A* pathfinding
Diffstat (limited to 'src/behaviour_system.h')
-rw-r--r-- | src/behaviour_system.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/behaviour_system.h b/src/behaviour_system.h index 0eb4772..526a09b 100644 --- a/src/behaviour_system.h +++ b/src/behaviour_system.h | |||
@@ -3,6 +3,12 @@ | |||
3 | 3 | ||
4 | #include "system.h" | 4 | #include "system.h" |
5 | #include "timer.h" | 5 | #include "timer.h" |
6 | #include "vector.h" | ||
7 | |||
8 | enum class PathfindingOptions { | ||
9 | None = 0, | ||
10 | CardinalDirectionsOnly = 1 << 0 | ||
11 | }; | ||
6 | 12 | ||
7 | class Game; | 13 | class Game; |
8 | 14 | ||
@@ -15,8 +21,14 @@ public: | |||
15 | 21 | ||
16 | void tick(double dt) override; | 22 | void tick(double dt) override; |
17 | 23 | ||
24 | void directSpriteToLocation(int spriteId, vec2i pos, PathfindingOptions options = PathfindingOptions::None); | ||
25 | |||
26 | bool isFollowingPath(int spriteId); | ||
27 | |||
18 | private: | 28 | private: |
19 | 29 | ||
30 | void createPath(int spriteId); | ||
31 | |||
20 | Game& game_; | 32 | Game& game_; |
21 | Timer timer_ { 500 }; | 33 | Timer timer_ { 500 }; |
22 | }; | 34 | }; |