diff --git a/src/warchron/model/score_service.py b/src/warchron/model/score_service.py index f061729..40b0891 100644 --- a/src/warchron/model/score_service.py +++ b/src/warchron/model/score_service.py @@ -44,11 +44,17 @@ class ScoreService: ) -> Dict[str, ParticipantScore]: from warchron.model.result_checker import ResultChecker + if context_type == ContextType.CAMPAIGN: + camp = war.get_campaign(context_id) + camp_pids = camp.get_all_campaign_participants_ids() + participant_ids = [(camp.campaign_to_war_part_id(pid)) for pid in camp_pids] + elif context_type == ContextType.WAR: + participant_ids = war.get_all_war_participants_ids() scores = { pid: ParticipantScore( narrative_points={obj_id: 0 for obj_id in war.objectives} ) - for pid in war.participants + for pid in participant_ids } battles = ScoreService._get_battles_for_context(war, context_type, context_id) for battle in battles: