1
0
mirror of https://github.com/veden/Rampant.git synced 2025-04-15 11:46:55 +02:00
Rampant/libs/BaseProcessor.lua

32 lines
588 B
Lua
Raw Normal View History

2017-05-11 21:50:06 -07:00
local baseProcessor = {}
-- imports
local BASE_QUEUE_SIZE = constants.BASE_QUEUE_SIZE
-- imported functions
local mMin = math.min
-- module code
function baseProcessor.processBases(regionMap, surface, pendingStack, natives, tick)
local baseIndex = natives.baseIndex
local bases = natives.bases
local endIndex = mMin(baseIndex+BASE_QUEUE_SIZE, #bases)
for index = baseIndex, endIndex do
local base = bases[index]
end
if (endIndex == #bases) then
natives.baseIndex = 1
else
natives.baseIndex = endIndex + 1
end
end
return baseProcessor