46 constexpr hitbox& operator=(
hitbox const&)
noexcept =
default;
47 constexpr hitbox& operator=(
hitbox&&)
noexcept =
default;
52 hi::widget_id widget_id,
54 hitbox_type type = hitbox_type::_default) noexcept :
55 widget_id(widget_id), _elevation(elevation), type(type)
59 [[nodiscard]]
constexpr friend std::strong_ordering operator<=>(
hitbox const& lhs,
hitbox const& rhs)
noexcept
61 if ((lhs.widget_id == 0) == (rhs.widget_id == 0)) {
63 auto const elevation_ordering = lhs._elevation <=> rhs._elevation;
64 if (elevation_ordering == std::partial_ordering::equivalent) {
65 return std::to_underlying(lhs.type) <=> std::to_underlying(rhs.type);
66 }
else if (elevation_ordering == std::partial_ordering::less) {
67 return std::strong_ordering::less;
68 }
else if (elevation_ordering == std::partial_ordering::greater) {
69 return std::strong_ordering::greater;
73 }
else if (lhs.widget_id == 0) {
75 return std::strong_ordering::less;
78 return std::strong_ordering::greater;