compute campaign points from rounds
This commit is contained in:
parent
45c1d69a3f
commit
7c9c941864
9 changed files with 165 additions and 75 deletions
|
|
@ -413,6 +413,15 @@ class War:
|
|||
|
||||
# Battle methods
|
||||
|
||||
# TODO replace multiloops by internal has_* method
|
||||
def get_battle(self, battle_id: str) -> Battle:
|
||||
for camp in self.campaigns:
|
||||
for rnd in camp.rounds:
|
||||
for bat in rnd.battles.values():
|
||||
if bat.sector_id == battle_id:
|
||||
return bat
|
||||
raise KeyError("Round not found")
|
||||
|
||||
def create_battle(self, round_id: str, sector_id: str) -> Battle:
|
||||
camp = self.get_campaign_by_round(round_id)
|
||||
if camp is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue