fix canceled tie spent tokens

This commit is contained in:
Maxime Réaux 2026-02-24 10:04:16 +01:00
parent 31a2ebb9dc
commit 097823fab0
4 changed files with 25 additions and 3 deletions

View file

@ -130,6 +130,29 @@ class TieResolver:
)
)
@staticmethod
def cancel_tie_break(
war: War,
context_type: ContextType,
context_id: str,
) -> None:
war.events = [
ev
for ev in war.events
if not (
(
isinstance(ev, InfluenceSpent)
and ev.context_type == context_type
and ev.context_id == context_id
)
or (
isinstance(ev, TieResolved)
and ev.context_type == context_type
and ev.context_id == context_id
)
)
]
@staticmethod
def rank_by_tokens(
war: War,