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/vector.h | |
parent | 4be70b7d55493cdc2d5e909d5101e70a16bee6f1 (diff) | |
download | tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.tar.gz tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.tar.bz2 tanetane-e03683852cac9b31ca846fcf13ff53abf99232c7.zip |
Added A* pathfinding
Diffstat (limited to 'src/vector.h')
-rw-r--r-- | src/vector.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h index 9f6d54f..c7b58dc 100644 --- a/src/vector.h +++ b/src/vector.h | |||
@@ -109,6 +109,10 @@ public: | |||
109 | return (x() != other.x()) || (y() != other.y()); | 109 | return (x() != other.x()) || (y() != other.y()); |
110 | } | 110 | } |
111 | 111 | ||
112 | bool operator<(const vec2& other) const { | ||
113 | return std::tie(x(), y()) < std::tie(other.x(), other.y()); | ||
114 | } | ||
115 | |||
112 | }; | 116 | }; |
113 | 117 | ||
114 | using vec2i = vec2<int>; | 118 | using vec2i = vec2<int>; |