44 constexpr hitbox& operator=(
hitbox const&)
noexcept =
default;
45 constexpr hitbox& operator=(
hitbox&&)
noexcept =
default;
50 hi::widget_id widget_id,
52 hitbox_type type = hitbox_type::_default) noexcept :
53 widget_id(widget_id), _elevation(elevation), type(type)
57 [[nodiscard]]
constexpr friend std::strong_ordering operator<=>(
hitbox const& lhs,
hitbox const& rhs)
noexcept
59 if ((lhs.widget_id ==
nullptr) == (rhs.widget_id ==
nullptr)) {
61 hilet elevation_ordering = lhs._elevation <=> rhs._elevation;
62 if (elevation_ordering == std::partial_ordering::equivalent) {
63 return std::to_underlying(lhs.type) <=> std::to_underlying(rhs.type);
64 }
else if (elevation_ordering == std::partial_ordering::less) {
65 return std::strong_ordering::less;
66 }
else if (elevation_ordering == std::partial_ordering::greater) {
67 return std::strong_ordering::greater;
71 }
else if (lhs.widget_id ==
nullptr) {
73 return std::strong_ordering::less;
76 return std::strong_ordering::greater;