From b9124e796c2bb6fe693fc673469ebb1c7121d48c Mon Sep 17 00:00:00 2001 From: copygirl Date: Sat, 14 Oct 2023 15:56:27 +0200 Subject: [PATCH] Add region.check function --- region.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/region.lua b/region.lua index 290d8d4..4313100 100644 --- a/region.lua +++ b/region.lua @@ -1,5 +1,5 @@ -local math, setmetatable, vector - = math, setmetatable, vector +local math, getmetatable, setmetatable, vector + = math, getmetatable, setmetatable, vector local math_min, math_max, math_floor, math_ceil, math_round = math.min, math.max, math.floor, math.ceil, math.round @@ -134,6 +134,10 @@ function region:iter_node_positions() end end +function region:check() + return getmetatable(self) == metatable +end + function region.equals(a, b) return vector.equals(a.min, b.min) and vector.equals(a.max, b.max)