c1_lua/lua/app/module/battle/helper/board_helper.lua
2023-06-29 15:22:42 +08:00

18 lines
622 B
Lua

local BoardHelper = {}
function BoardHelper:findPvpLinkOptimalSolution(battleController, minRow, maxRow)
local battleData = battleController.battleData
local gridEntities = {}
for row = minRow, maxRow do -- 遍历所有的可使用格子
for column = 1, GConst.BattleConst.COLUMN_COUNT do
local posId = ModuleManager.BattleManager:getPosId(row, column)
local gridEntity = battleData:getGridEnties()[posId]
if gridEntity and gridEntity:canLink() then
table.insert(gridEntities, gridEntity)
end
end
end
end
return BoardHelper