display battle tie-break token
This commit is contained in:
parent
818d2886f4
commit
23110383c2
9 changed files with 127 additions and 29 deletions
|
|
@ -106,3 +106,18 @@ class TieResolver:
|
|||
return ev.participant_id # None if confirmed draw
|
||||
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def was_tie_broken_by_tokens(
|
||||
war: War,
|
||||
context_type: ContextType,
|
||||
context_id: str,
|
||||
) -> bool:
|
||||
for ev in reversed(war.events):
|
||||
if (
|
||||
isinstance(ev, TieResolved)
|
||||
and ev.context_type == context_type
|
||||
and ev.context_id == context_id
|
||||
):
|
||||
return ev.participant_id is not None
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue