From e37e7e408c4b748e5d8c07e5fe230b53b3b789d3 Mon Sep 17 00:00:00 2001 From: Vladimir Olteanu Date: Wed, 2 Jun 2021 05:23:55 +0300 Subject: [PATCH] Introduce Point::WalkingDistance --- Source/engine.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/engine.h b/Source/engine.h index a965b2844..e33a4030a 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -202,6 +202,13 @@ struct Point { return offset.x + offset.y; } + + int WalkingDistance(Point other) const + { + Point offset = abs(*this - other); + + return std::max(offset.x, offset.y); + } }; struct Size {