Commit 6643da66 authored by 未闻皂名's avatar 未闻皂名

2025/10/22 使用CancelableSelect减少选取的卡顿

parent 3457f111
Pipeline #41193 passed with stages
in 5 minutes and 59 seconds
......@@ -161,34 +161,7 @@ function RushDuel.SelectGroup(player, group, min, max)
end
end
-- 多选
local sg = Group.CreateGroup()
local finish = (#sg >= min and #sg <= max)
while #sg < max do
local cg = group:Clone()
cg:Sub(sg)
finish = (#sg >= min and #sg <= max)
if #cg == 0 then
break
end
local cancel = not finish
local tc = cg:SelectUnselect(sg, player, finish, cancel, min, max)
if not tc then
break
end
if not sg:IsContains(tc) then
sg:AddCard(tc)
if #sg == max then
finish = true
end
else
sg:RemoveCard(tc)
end
end
if finish then
return sg
else
return nil
end
return group:CancelableSelect(player, min, max, nil)
end
-- 让玩家可以选择卡片组的 min ~ max 张卡
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment