split dialogs and war/campaign/round classes to files
This commit is contained in:
parent
55abdccc64
commit
019e62565f
22 changed files with 562 additions and 502 deletions
|
|
@ -2,7 +2,11 @@ from __future__ import annotations
|
|||
from uuid import uuid4
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from warchron.model.round import Round, Choice, Battle
|
||||
from warchron.model.campaign_participant import CampaignParticipant
|
||||
from warchron.model.sector import Sector
|
||||
from warchron.model.round import Round
|
||||
from warchron.model.choice import Choice
|
||||
from warchron.model.battle import Battle
|
||||
|
||||
|
||||
class Campaign:
|
||||
|
|
@ -227,62 +231,3 @@ class Campaign:
|
|||
def remove_battle(self, round_id: str, sector_id: str) -> None:
|
||||
rnd = self.get_round(round_id)
|
||||
rnd.remove_battle(sector_id)
|
||||
|
||||
|
||||
class CampaignParticipant:
|
||||
def __init__(
|
||||
self, *, war_participant_id: str, leader: str | None, theme: str | None
|
||||
):
|
||||
self.id: str = str(uuid4())
|
||||
self.war_participant_id: str = war_participant_id # ref to War.participants
|
||||
self.leader: str | None = leader
|
||||
self.theme: str | None = theme
|
||||
|
||||
def set_id(self, new_id: str) -> None:
|
||||
self.id = new_id
|
||||
|
||||
def set_war_participant(self, new_participant: str) -> None:
|
||||
self.war_participant_id = new_participant
|
||||
|
||||
def set_leader(self, new_faction: str) -> None:
|
||||
self.leader = new_faction
|
||||
|
||||
def set_theme(self, new_theme: str) -> None:
|
||||
self.theme = new_theme
|
||||
|
||||
|
||||
class Sector:
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
round_id: str,
|
||||
major_id: str | None,
|
||||
minor_id: str | None,
|
||||
influence_id: str | None,
|
||||
):
|
||||
self.id: str = str(uuid4())
|
||||
self.name: str = name
|
||||
self.round_id: str = round_id
|
||||
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) -> None:
|
||||
self.id = new_id
|
||||
|
||||
def set_name(self, new_name: str) -> None:
|
||||
self.name = new_name
|
||||
|
||||
def set_round(self, new_round_id: str) -> None:
|
||||
self.round_id = new_round_id
|
||||
|
||||
def set_major(self, new_major_id: str) -> None:
|
||||
self.major_objective_id = new_major_id
|
||||
|
||||
def set_minor(self, new_minor_id: str) -> None:
|
||||
self.minor_objective_id = new_minor_id
|
||||
|
||||
def set_influence(self, new_influence_id: str) -> None:
|
||||
self.influence_objective_id = new_influence_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue