parent
19052f501c
commit
d3aed7242a
|
@ -121,7 +121,7 @@ end
|
|||
---@return GameEvent[] @ 找到的符合条件的所有事件,最多n个但不保证有n个
|
||||
function GameEvent:searchEvents(eventType, n, func, endEvent)
|
||||
local logic = self.room.logic
|
||||
local events = logic.event_recorder[eventType]
|
||||
local events = logic.event_recorder[eventType] or Util.DummyTable
|
||||
local from = self.id
|
||||
local to = endEvent and endEvent.id or self.end_id
|
||||
if to == -1 then to = #logic.all_game_events end
|
||||
|
|
|
@ -473,11 +473,11 @@ function GameLogic:getEventsOfScope(eventType, n, func, scope)
|
|||
if scope == Player.HistoryGame then
|
||||
start_event = self.all_game_events[1]
|
||||
elseif scope == Player.HistoryRound then
|
||||
start_event = event:findParent(GameEvent.Round)
|
||||
start_event = event:findParent(GameEvent.Round, true)
|
||||
elseif scope == Player.HistoryTurn then
|
||||
start_event = event:findParent(GameEvent.Turn)
|
||||
start_event = event:findParent(GameEvent.Turn, true)
|
||||
elseif scope == Player.HistoryPhase then
|
||||
start_event = event:findParent(GameEvent.Phase)
|
||||
start_event = event:findParent(GameEvent.Phase, true)
|
||||
end
|
||||
|
||||
return start_event:searchEvents(eventType, n, func)
|
||||
|
|
Loading…
Reference in New Issue