wip close round/campaign/war + refacto json None
This commit is contained in:
parent
4c8086caf4
commit
6cbb7c6534
26 changed files with 474 additions and 108 deletions
|
|
@ -146,7 +146,12 @@ class Campaign:
|
|||
)
|
||||
|
||||
def add_sector(
|
||||
self, name: str, round_id: str, major_id: str, minor_id: str, influence_id: str
|
||||
self,
|
||||
name: str,
|
||||
round_id: str | None,
|
||||
major_id: str | None,
|
||||
minor_id: str | None,
|
||||
influence_id: str | None,
|
||||
) -> Sector:
|
||||
sect = Sector(name, round_id, major_id, minor_id, influence_id)
|
||||
self.sectors[sect.id] = sect
|
||||
|
|
@ -168,10 +173,10 @@ class Campaign:
|
|||
sector_id: str,
|
||||
*,
|
||||
name: str,
|
||||
round_id: str,
|
||||
major_id: str,
|
||||
minor_id: str,
|
||||
influence_id: str,
|
||||
round_id: str | None,
|
||||
major_id: str | None,
|
||||
minor_id: str | None,
|
||||
influence_id: str | None,
|
||||
) -> None:
|
||||
sect = self.get_sector(sector_id)
|
||||
old_round_id = sect.round_id
|
||||
|
|
@ -308,6 +313,9 @@ class Campaign:
|
|||
|
||||
# Battle methods
|
||||
|
||||
def all_rounds_finished(self) -> bool:
|
||||
return all(r.is_over for r in self.rounds)
|
||||
|
||||
def create_battle(self, round_id: str, sector_id: str) -> Battle:
|
||||
rnd = self.get_round(round_id)
|
||||
return rnd.create_battle(sector_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue