finish score_value refacto using is_tie_resolved

This commit is contained in:
Maxime Réaux 2026-02-26 10:55:28 +01:00
parent 58589b8dc1
commit 5a64a294c5

View file

@ -27,10 +27,10 @@ class TieResolver:
for battle in round.battles.values():
if not battle.is_draw():
continue
# TODO remove test without score
if TieResolver.is_tie_resolved(war, ContextType.BATTLE, battle.sector_id):
if TieResolver.is_tie_resolved(
war, ContextType.BATTLE, battle.sector_id, None
):
continue
if campaign is None:
raise RuntimeError("No campaign for this battle tie")
if battle.player_1_id is None or battle.player_2_id is None:
@ -56,9 +56,6 @@ class TieResolver:
@staticmethod
def find_campaign_ties(war: War, campaign_id: str) -> List[TieContext]:
# TODO remove test without score
if TieResolver.is_tie_resolved(war, ContextType.CAMPAIGN, campaign_id):
return []
scores = ScoreService.compute_scores(war, ContextType.CAMPAIGN, campaign_id)
buckets: DefaultDict[int, List[str]] = defaultdict(list)
for pid, score in scores.items():
@ -90,9 +87,6 @@ class TieResolver:
@staticmethod
def find_war_ties(war: War) -> List[TieContext]:
# TODO remove test without score
if TieResolver.is_tie_resolved(war, ContextType.WAR, war.id):
return []
scores = ScoreService.compute_scores(war, ContextType.WAR, war.id)
buckets: DefaultDict[int, List[str]] = defaultdict(list)
for pid, score in scores.items():