Initial commit

This commit is contained in:
Nikita Kruglickiy
2020-12-25 22:18:23 +06:00
commit 1a0785862d
21 changed files with 1181 additions and 0 deletions

View File

11
koptilnya/libs/utils.txt Normal file
View File

@@ -0,0 +1,11 @@
function checkVarClass(var, class, message)
if type(var) ~= "table" or var["class"] == nil or not var:isInstanceOf(class) then
throw(message == nil and "Wrong variable class." or message, 1, true)
end
end
function accessorFunc(tbl, varName, name, defaultValue)
tbl[varName] = defaultValue
tbl["get" .. name] = function(self) return self[varName] end
tbl["set" .. name] = function(self, value) self[varName] = value end
end