Add Lua cargo insertion code and Utils.Skip. Needed for Allies 03 Classic.

This commit is contained in:
ScottNZ
2013-12-16 19:02:35 +13:00
parent b2e9de810e
commit e8fb96c55f
3 changed files with 33 additions and 2 deletions

View File

@@ -56,12 +56,22 @@ Utils.Any = function(array, func)
return false
end
Utils.ForEach = function(array, func)
Utils.Do = function(array, func)
for i, item in ipairs(array) do
func(item)
end
end
Utils.Skip = function(array, n)
local ret = { }
for i, item in ipairs(array) do
if i > n then
table.insert(ret, item)
end
end
return ret
end
Utils.TableToArray = function(luaTable)
return Internal.TableToArray(luaTable)
end