diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-26 18:18:45 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-02-26 20:06:25 +0100 |
commit | 8a380af2b8f28400f29a5468a3a1a5629a665867 (patch) | |
tree | 7576a88b5a99a8fb043c5b4d8e8ccf7ddfed6227 /src/global-coords.hpp | |
parent | a8bb842d388a9935342f3fa3e807551c3804d5f1 (diff) |
implement formatting chunk_coords{,_} to corrade's Debug{}
Diffstat (limited to 'src/global-coords.hpp')
-rw-r--r-- | src/global-coords.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/global-coords.hpp b/src/global-coords.hpp index 03dfc67e..ef571b18 100644 --- a/src/global-coords.hpp +++ b/src/global-coords.hpp @@ -11,6 +11,7 @@ struct chunk_coords final { int16_t x = 0, y = 0; constexpr bool operator==(const chunk_coords& other) const noexcept = default; + friend Debug& operator<<(Debug& dbg, const chunk_coords& pt); template<typename T> explicit constexpr operator Math::Vector2<T>() const noexcept @@ -36,7 +37,9 @@ struct chunk_coords_ final { constexpr chunk_coords_() noexcept = default; constexpr chunk_coords_(int16_t x, int16_t y, int8_t z) noexcept : x{x}, y{y}, z{z} {} constexpr chunk_coords_(chunk_coords c, int8_t z) noexcept : x{c.x}, y{c.y}, z{z} {} + constexpr bool operator==(const chunk_coords_&) const noexcept = default; + friend Debug& operator<<(Debug& dbg, const chunk_coords_& pt); template<typename T> requires std::is_integral_v<T> constexpr chunk_coords_ operator+(Math::Vector2<T> off) const noexcept { |