18 enum class Type : uint8_t {
28 BottomLeftResizeCorner,
29 BottomRightResizeCorner,
40 constexpr hitbox &operator=(
hitbox const &)
noexcept =
default;
41 constexpr hitbox &operator=(
hitbox &&)
noexcept =
default;
48 Type type = Type::Default) noexcept :
53 constexpr hitbox(hi::widget
const *
widget,
point3 position, Type type = Type::Default) noexcept :
58 [[nodiscard]]
constexpr friend std::strong_ordering operator<=>(
hitbox const &lhs,
hitbox const &rhs)
noexcept
60 if ((lhs.widget ==
nullptr) == (rhs.widget ==
nullptr)) {
62 hilet elevation_cmp = lhs._elevation <=> rhs._elevation;
63 if (elevation_cmp == 0) {
64 return static_cast<int>(lhs.type) <=>
static_cast<int>(rhs.type);
65 }
else if (elevation_cmp < 0) {
66 return std::strong_ordering::less;
67 }
else if (elevation_cmp > 0) {
68 return std::strong_ordering::greater;
72 }
else if (lhs.widget ==
nullptr) {
74 return std::strong_ordering::less;
77 return std::strong_ordering::greater;