From 2db41e237f3c8ba2e93c6c4280d23370f974db88 Mon Sep 17 00:00:00 2001 From: GreenComfyTea Date: Mon, 21 Aug 2023 17:25:07 +0300 Subject: [PATCH] utils.type: Add is_boolean(), is_REField(), is_REMethodDefinition() --- reframework/autorun/MHR_Overlay/Misc/utils.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reframework/autorun/MHR_Overlay/Misc/utils.lua b/reframework/autorun/MHR_Overlay/Misc/utils.lua index 39eaf47..e39671f 100644 --- a/reframework/autorun/MHR_Overlay/Misc/utils.lua +++ b/reframework/autorun/MHR_Overlay/Misc/utils.lua @@ -44,6 +44,7 @@ local unicode_chars; local epsilon = 0.000001; this.table = {}; +this.type = {}; this.number = {}; this.string = {}; this.vec2 = {}; @@ -215,6 +216,18 @@ function this.table.merge(...) return result; end +function this.type.is_boolean(value) + return value == true or value == false; +end + +function this.type.is_REField(value) + return value.get_return_type == nil; +end + +function this.type.is_REMethodDefinition(value) + return value.get_return_type ~= nil; +end + function this.number.is_NaN(value) return tostring(value) == tostring(0/0); end