This commit is contained in:
Nikita Kruglickiy
2023-05-22 19:06:26 +03:00
parent 345e60cf1d
commit 09be0ea795
35 changed files with 1423 additions and 336 deletions

View File

@@ -1,3 +1,5 @@
--@name koptilnya/libs/constants
NULL_ENTITY = entity(0)
CURRENT_PLAYER = player()
OWNER = owner()
@@ -7,3 +9,5 @@ RAD_TO_RPM = 9.5493
RPM_TO_RAD = 0.10472
UNITS_PER_METER = 39.37
UNITS_TO_METERS = 0.01905
KG_TO_N = 9.80665
KG_TO_KN = 0.00980665

View File

@@ -1,3 +1,4 @@
--@name /koptilnya/libs/perma
-- @include /koptilnya/libs/table.txt
-- @shared

View File

@@ -82,6 +82,8 @@ function table.find(tbl, predicate)
return field
end
end
return nil
end
function table.reduce(tbl, reducer, init)
@@ -93,3 +95,17 @@ function table.reduce(tbl, reducer, init)
return accum
end
function table.every(tbl, predicate)
for i, field in pairs(tbl) do
if not predicate(field, i) then
return false
end
end
return true
end
function table.some(tbl, predicate)
return table.find(tbl, predicate) ~= nil
end