finish score_value refacto using is_tie_resolved
This commit is contained in:
parent
58589b8dc1
commit
5a64a294c5
1 changed files with 3 additions and 9 deletions
|
|
@ -27,10 +27,10 @@ class TieResolver:
|
||||||
for battle in round.battles.values():
|
for battle in round.battles.values():
|
||||||
if not battle.is_draw():
|
if not battle.is_draw():
|
||||||
continue
|
continue
|
||||||
# TODO remove test without score
|
if TieResolver.is_tie_resolved(
|
||||||
if TieResolver.is_tie_resolved(war, ContextType.BATTLE, battle.sector_id):
|
war, ContextType.BATTLE, battle.sector_id, None
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if campaign is None:
|
if campaign is None:
|
||||||
raise RuntimeError("No campaign for this battle tie")
|
raise RuntimeError("No campaign for this battle tie")
|
||||||
if battle.player_1_id is None or battle.player_2_id is None:
|
if battle.player_1_id is None or battle.player_2_id is None:
|
||||||
|
|
@ -56,9 +56,6 @@ class TieResolver:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def find_campaign_ties(war: War, campaign_id: str) -> List[TieContext]:
|
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)
|
scores = ScoreService.compute_scores(war, ContextType.CAMPAIGN, campaign_id)
|
||||||
buckets: DefaultDict[int, List[str]] = defaultdict(list)
|
buckets: DefaultDict[int, List[str]] = defaultdict(list)
|
||||||
for pid, score in scores.items():
|
for pid, score in scores.items():
|
||||||
|
|
@ -90,9 +87,6 @@ class TieResolver:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def find_war_ties(war: War) -> List[TieContext]:
|
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)
|
scores = ScoreService.compute_scores(war, ContextType.WAR, war.id)
|
||||||
buckets: DefaultDict[int, List[str]] = defaultdict(list)
|
buckets: DefaultDict[int, List[str]] = defaultdict(list)
|
||||||
for pid, score in scores.items():
|
for pid, score in scores.items():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue