simplify unused objectives display and tie-break

This commit is contained in:
Maxime Réaux 2026-03-06 16:39:22 +01:00
parent 9b28e85557
commit 0c6014e946
5 changed files with 31 additions and 11 deletions

View file

@ -175,6 +175,14 @@ class War:
def get_all_objectives(self) -> List[Objective]:
return list(self.objectives.values())
def get_objectives_used_as_maj_or_min(self) -> List[Objective]:
obj_ids: set[str] = set()
for camp in self.campaigns:
obj_ids.update(camp.get_objectives_used_as_maj_or_min())
return [
self.objectives[obj_id] for obj_id in obj_ids if obj_id in self.objectives
]
def get_objective_name(self, objective_id: str | None) -> str:
if objective_id is None:
return ""