refacto update ; pretify code

This commit is contained in:
Maxime Réaux 2026-02-02 10:41:16 +01:00
parent 6bd3ee31dc
commit fbb1c913ba
11 changed files with 594 additions and 310 deletions

View file

@ -161,6 +161,15 @@ class Campaign:
rnd = self.get_round(round_id)
return rnd.create_choice(participant_id)
def update_choice(self,
round_id: str,
participant_id: str,
priority_sector_id: str | None,
secondary_sector_id: str | None,
comment: str | None):
rnd = self.get_round(round_id)
rnd.update_choice(participant_id, priority_sector_id, secondary_sector_id, comment)
def remove_choice(self, round_id: str, participant_id: str) -> Choice:
rnd = self.get_round(round_id)
rnd.remove_choice(participant_id)
@ -170,6 +179,18 @@ class Campaign:
def create_battle(self, round_id: str, sector_id: str) -> Battle:
rnd = self.get_round(round_id)
return rnd.create_battle(sector_id)
def update_battle(self,
round_id: str,
sector_id: str,
player_1_id: str | None,
player_2_id: str | None,
winner_id: str | None,
score: str | None,
victory_condition: str | None,
comment: str | None):
rnd = self.get_round(round_id)
rnd.update_battle(sector_id, player_1_id, player_2_id, winner_id, score, victory_condition, comment)
def remove_battle(self, round_id: str, sector_id: str) -> Battle:
rnd = self.get_round(round_id)