fix canceled tie spent tokens
This commit is contained in:
parent
31a2ebb9dc
commit
097823fab0
4 changed files with 25 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue