31 lines
715 B
Lua
31 lines
715 B
Lua
|
local ConditionsUtils = {}
|
||
|
|
||
|
function ConditionsUtils.testVariables(var1, testType, var2)
|
||
|
local var2 = tonumber(var2)
|
||
|
if (testType == "eq" and var1 == var2) then
|
||
|
return true
|
||
|
end
|
||
|
if (testType == "ne" and var1 ~= var2) then
|
||
|
return true
|
||
|
end
|
||
|
if (testType == "gt" and var1 > var2) then
|
||
|
return true
|
||
|
end
|
||
|
if (testType == "ge" and var1 >= var2) then
|
||
|
return true
|
||
|
end
|
||
|
if (testType == "lt" and var1 < var2) then
|
||
|
return true
|
||
|
end
|
||
|
if (testType == "le" and var1 <= var2) then
|
||
|
return true
|
||
|
end
|
||
|
|
||
|
return false
|
||
|
end
|
||
|
|
||
|
function ConditionsUtils.testBool(bool, boolType)
|
||
|
return (bool == (boolType == "V"))
|
||
|
end
|
||
|
|
||
|
return ConditionsUtils;
|