Equality operators for TileCoordsXYZ

Introduce operator == and operator != for TileCoordsXYZ, so that we can more easily operate on them in tests.
This commit is contained in:
Richard Fine 2018-12-29 23:47:21 +00:00
parent a065806b20
commit b845304656
1 changed files with 10 additions and 0 deletions

View File

@ -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;
};