diff --git a/include/fggl/grid/hexagon.hpp b/include/fggl/grid/hexagon.hpp index be211071d673c4230351b45cee928c08eca17050..955961e41434531cd5bdf9d9c12cc4ab0453e55b 100644 --- a/include/fggl/grid/hexagon.hpp +++ b/include/fggl/grid/hexagon.hpp @@ -22,6 +22,7 @@ #include <array> #include <vector> #include <cmath> +#include <compare> #include <fggl/math/fmath.hpp> @@ -83,6 +84,12 @@ namespace fggl::grid { return { m_pos[0] - other.m_pos[0], m_pos[1] - other.m_pos[1] }; } + bool operator==(const HexPointT<T>& other) const { + return m_pos[0] == other.m_pos[0] && m_pos[1] == m_pos[1]; + } + + auto operator<=>(const HexPointT<T>& other) const = default; + T distance(const HexPointT& other) const { auto vec = *this - other; return (