fix re-enable token on closed camapign + refacto war_event attributes

This commit is contained in:
Maxime Réaux 2026-02-25 16:54:21 +01:00
parent 5c124f9229
commit 6efd22527a
8 changed files with 108 additions and 57 deletions

View file

@ -1,4 +1,4 @@
from typing import List, Dict, TYPE_CHECKING
from typing import List, Dict, Tuple, TYPE_CHECKING
from PyQt6.QtWidgets import QDialog
from PyQt6.QtWidgets import QMessageBox
@ -179,7 +179,7 @@ class RoundController:
def resolve_ties(
self, war: War, contexts: List[TieContext]
) -> Dict[str, Dict[str, bool]]:
) -> Dict[Tuple[ContextType, str, int | None], Dict[str, bool]]:
bids_map = {}
for ctx in contexts:
players = [
@ -198,9 +198,13 @@ class RoundController:
context_id=ctx.context_id,
)
if not dialog.exec():
TieResolver.cancel_tie_break(war, ContextType.BATTLE, ctx.context_id)
TieResolver.cancel_tie_break(
war, ContextType.BATTLE, ctx.context_id, ctx.score_value
)
raise ForbiddenOperation("Tie resolution cancelled")
bids_map[ctx.context_id] = dialog.get_bids()
bids_map[(ctx.context_type, ctx.context_id, ctx.score_value)] = (
dialog.get_bids()
)
return bids_map
# Choice methods