From 70e245a1c36bcd40a005b89f851afe746fb92cce Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Tue, 30 Jun 2020 09:12:14 -0300 Subject: [PATCH] Add Coords constructor to Map and CoordsRange --- src/openrct2/world/Location.hpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 64f2b53de2..773ffb5bfa 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -636,8 +636,13 @@ template struct CoordsRange CoordsRange() = default; CoordsRange(int32_t left, int32_t top, int32_t right, int32_t bottom) - : LeftTop(left, top) - , RightBottom(right, bottom) + : CoordsRange({ left, top }, { right, bottom }) + { + } + + CoordsRange(const T& leftTop, const T& rightBottom) + : LeftTop(leftTop) + , RightBottom(rightBottom) { } }; @@ -650,7 +655,12 @@ struct MapRange : public CoordsRange { using CoordsRange::CoordsRange; MapRange(int32_t left, int32_t top, int32_t right, int32_t bottom) - : CoordsRange(left, top, right, bottom) + : MapRange({ left, top }, { right, bottom }) + { + } + + MapRange(const CoordsXY& leftTop, const CoordsXY& rightBottom) + : CoordsRange(leftTop, rightBottom) { // Make sure it's a rectangle assert(std::abs(GetLeft() - GetRight()) > 0);