split dialogs and war/campaign/round classes to files

This commit is contained in:
Maxime Réaux 2026-02-05 08:42:38 +01:00
parent 55abdccc64
commit 019e62565f
22 changed files with 562 additions and 502 deletions

View file

@ -2,6 +2,9 @@ from __future__ import annotations
from uuid import uuid4
from typing import Any, Dict
from warchron.model.choice import Choice
from warchron.model.battle import Battle
class Round:
def __init__(self) -> None:
@ -98,69 +101,3 @@ class Round:
def remove_battle(self, sector_id: str) -> None:
del self.battles[sector_id]
class Choice:
def __init__(
self,
participant_id: str,
priority_sector_id: str | None = None,
secondary_sector_id: str | None = None,
):
self.participant_id: str = participant_id # ref to Campaign.participants
self.priority_sector_id: str | None = (
priority_sector_id # ref to Campaign.sectors
)
self.secondary_sector_id: str | None = (
secondary_sector_id # ref to Campaign.sectors
)
self.comment: str | None = None
def set_id(self, new_id: str) -> None:
self.participant_id = new_id
def set_priority(self, new_priority_id: str | None) -> None:
self.priority_sector_id = new_priority_id
def set_secondary(self, new_secondary_id: str | None) -> None:
self.secondary_sector_id = new_secondary_id
def set_comment(self, new_comment: str | None) -> None:
self.comment = new_comment
class Battle:
def __init__(
self,
sector_id: str,
player_1_id: str | None = None,
player_2_id: str | None = None,
):
self.sector_id: str = sector_id # ref to Campaign.sector
self.player_1_id: str | None = player_1_id # ref to Campaign.participants
self.player_2_id: str | None = player_2_id # ref to Campaign.participants
self.winner_id: str | None = None
self.score: str | None = None
self.victory_condition: str | None = None
self.comment: str | None = None
def set_id(self, new_id: str) -> None:
self.sector_id = new_id
def set_player_1(self, new_player_id: str | None) -> None:
self.player_1_id = new_player_id
def set_player_2(self, new_player_id: str | None) -> None:
self.player_2_id = new_player_id
def set_winner(self, new_player_id: str | None) -> None:
self.winner_id = new_player_id
def set_score(self, new_score: str | None) -> None:
self.score = new_score
def set_victory_condition(self, new_victory_condition: str | None) -> None:
self.victory_condition = new_victory_condition
def set_comment(self, new_comment: str | None) -> None:
self.comment = new_comment