From b845304656ea2bb054bc830538bfe28a6ccf03f9 Mon Sep 17 00:00:00 2001 From: Richard Fine Date: Sat, 29 Dec 2018 23:47:21 +0000 Subject: [PATCH] Equality operators for TileCoordsXYZ Introduce operator == and operator != for TileCoordsXYZ, so that we can more easily operate on them in tests. --- src/openrct2/world/Location.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index cc057d0c25..950a2937c6 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -116,6 +116,16 @@ struct TileCoordsXYZ y += rhs.y; return *this; } + + bool operator==(const TileCoordsXYZ& other) const + { + return x == other.x && y == other.y && z == other.z; + } + bool operator!=(const TileCoordsXYZ& other) const + { + return !(*this == other); + } + int32_t x = 0, y = 0, z = 0; };