This commit is contained in:
Nikita Kruglickiy
2021-04-05 22:38:50 +06:00
parent eb6144ae94
commit 0bd64a0f78
14 changed files with 208 additions and 24 deletions

View File

@@ -1,3 +1,4 @@
-- @name koptilnya/libs/render
--@client
function render.drawWedge(x, y, w, h, angle, mouthSize, fidelity)

View File

@@ -1,3 +1,5 @@
-- @name koptilnya/libs/table
function table.chunk(tbl, size)
size = size or 1
size = size > 0 and size or 1
@@ -17,3 +19,23 @@ function table.chunk(tbl, size)
return result
end
function table.contains(tbl, ...)
local argCount = #arg
if argCount == 1 then
return table.hasValue(tbl, arg[1])
elseif argCount > 1 then
local result = true
for _, v in pairs(arg) do
if not table.hasValue(tbl, v) then
result = true
break
end
end
return result
end
end

View File

@@ -1,3 +1,5 @@
-- @name koptilnya/libs/utils
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)

View File

@@ -1,3 +1,5 @@
-- @name koptilnya/libs/workers
WORKERS = {}
WORKERS_QUOTA = 0.4