diff options
| author | Shauren <shauren.trinity@gmail.com> | 2023-08-24 11:48:45 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2023-08-24 11:48:45 +0200 |
| commit | 451314241dc40c4e3be600ef95a4f4fbd322f701 (patch) | |
| tree | 1c55abe5e0027df578a792015254e4b95b8e6d80 /src/server/game/Entities | |
| parent | 343d09bc95ade0cc34f953b56cbe666baca387fc (diff) | |
Core/Misc: Modernize comparison operators
(cherry picked from commit f0a862e71bc12d86a898901ef773475a7c964832)
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObjectData.h | 2 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/ObjectGuid.h | 5 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Position.h | 1 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Entities/GameObject/GameObjectData.h b/src/server/game/Entities/GameObject/GameObjectData.h index 5f68c3f7b16..40eda9ce862 100644 --- a/src/server/game/Entities/GameObject/GameObjectData.h +++ b/src/server/game/Entities/GameObject/GameObjectData.h @@ -664,6 +664,8 @@ struct TC_GAME_API QuaternionData bool isUnit() const; void toEulerAnglesZYX(float& Z, float& Y, float& X) const; static QuaternionData fromEulerAnglesZYX(float Z, float Y, float X); + + friend bool operator==(QuaternionData const& left, QuaternionData const& right) = default; }; // `gameobject_addon` table diff --git a/src/server/game/Entities/Object/ObjectGuid.h b/src/server/game/Entities/Object/ObjectGuid.h index 46b23671257..1a6ccb775b2 100644 --- a/src/server/game/Entities/Object/ObjectGuid.h +++ b/src/server/game/Entities/Object/ObjectGuid.h @@ -203,9 +203,8 @@ class TC_GAME_API ObjectGuid TypeID GetTypeId() const { return GetTypeId(GetHigh()); } bool operator!() const { return IsEmpty(); } - bool operator==(ObjectGuid const& guid) const { return GetRawValue() == guid.GetRawValue(); } - bool operator!=(ObjectGuid const& guid) const { return GetRawValue() != guid.GetRawValue(); } - bool operator< (ObjectGuid const& guid) const { return GetRawValue() < guid.GetRawValue(); } + bool operator==(ObjectGuid const& right) const = default; + std::strong_ordering operator<=>(ObjectGuid const& right) const = default; static char const* GetTypeName(HighGuid high); char const* GetTypeName() const { return !IsEmpty() ? GetTypeName(GetHigh()) : "None"; } diff --git a/src/server/game/Entities/Object/Position.h b/src/server/game/Entities/Object/Position.h index d029c270380..69f57b250a1 100644 --- a/src/server/game/Entities/Object/Position.h +++ b/src/server/game/Entities/Object/Position.h @@ -62,7 +62,6 @@ private: public: bool operator==(Position const& a) const; - bool operator!=(Position const& a) const { return !(operator==(a)); } void Relocate(float x, float y) { m_positionX = x; m_positionY = y; } void Relocate(float x, float y, float z) { Relocate(x, y); m_positionZ = z; } |
