auto create & edit battles
This commit is contained in:
parent
9f676f6b9d
commit
6bd3ee31dc
10 changed files with 442 additions and 55 deletions
|
|
@ -108,6 +108,13 @@ class Campaign:
|
|||
# TODO manage battles referring to it
|
||||
del self.sectors[sector_id]
|
||||
|
||||
def get_sectors_in_round(self, round_id: str) -> list[Sector]:
|
||||
sectors = [
|
||||
s for s in self.sectors.values()
|
||||
if s.round_id == round_id
|
||||
]
|
||||
return sectors
|
||||
|
||||
# Round methods
|
||||
|
||||
def has_round(self, round_id: str) -> bool:
|
||||
|
|
@ -158,8 +165,18 @@ class Campaign:
|
|||
rnd = self.get_round(round_id)
|
||||
rnd.remove_choice(participant_id)
|
||||
|
||||
# Battle methods
|
||||
|
||||
def create_battle(self, round_id: str, sector_id: str) -> Battle:
|
||||
rnd = self.get_round(round_id)
|
||||
return rnd.create_battle(sector_id)
|
||||
|
||||
def remove_battle(self, round_id: str, sector_id: str) -> Battle:
|
||||
rnd = self.get_round(round_id)
|
||||
rnd.remove_battle(sector_id)
|
||||
|
||||
class CampaignParticipant:
|
||||
def __init__(self,player_id: str, leader: str, theme: str):
|
||||
def __init__(self, player_id: str, leader: str, theme: str):
|
||||
self.id: str = player_id # ref to War.participants
|
||||
self.leader: str = leader
|
||||
self.theme: str = theme
|
||||
|
|
@ -181,6 +198,8 @@ class Sector:
|
|||
self.major_objective_id: str | None = major_id # ref to War.objectives
|
||||
self.minor_objective_id: str | None = minor_id # ref to War.objectives
|
||||
self.influence_objective_id: str | None = influence_id # ref to War.objectives
|
||||
self.mission: str | None = None
|
||||
self.description: str | None = None
|
||||
|
||||
def set_id(self, new_id: str):
|
||||
self.id = new_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue