Compare commits
No commits in common. "main" and "feature/task" have entirely different histories.
main
...
feature/ta
@ -8,7 +8,7 @@ grid.__index = grid
|
||||
--- adds a value to the grid
|
||||
--- @param value any
|
||||
function grid:add(value)
|
||||
self.__grid[tostring(value.position)] = value
|
||||
grid[tostring(value.position)] = value
|
||||
end
|
||||
|
||||
--- @param position Vec3
|
||||
|
||||
@ -40,7 +40,6 @@ end
|
||||
function level:update(dt)
|
||||
utils.each(self.deadIds, function(id)
|
||||
self.characters[id] = nil
|
||||
self.turnOrder:remove(id)
|
||||
end)
|
||||
self.deadIds = {}
|
||||
|
||||
|
||||
@ -117,29 +117,4 @@ function turnOrder:add(id)
|
||||
self.actedQueue:insert(id) -- новые персонажи по умолчанию попадают в очередь следующего хода
|
||||
end
|
||||
|
||||
--- Удалить персонажа из очереди хода (например, при смерти)
|
||||
--- @param id Id
|
||||
function turnOrder:remove(id)
|
||||
if self.current == id then
|
||||
self.current = self.pendingQueue:pop()
|
||||
if not self.current then
|
||||
self:endRound()
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local function filterQueue(q, targetId)
|
||||
local newQ = PriorityQueue.new(initiativeComparator)
|
||||
for _, val in ipairs(q.data) do
|
||||
if val ~= targetId then
|
||||
newQ:insert(val)
|
||||
end
|
||||
end
|
||||
return newQ
|
||||
end
|
||||
|
||||
self.actedQueue = filterQueue(self.actedQueue, id)
|
||||
self.pendingQueue = filterQueue(self.pendingQueue, id)
|
||||
end
|
||||
|
||||
return { new = new }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user