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
|
|
@ -3,8 +3,14 @@ from uuid import uuid4
|
|||
from datetime import datetime
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from warchron.model.campaign import Campaign, Sector, CampaignParticipant
|
||||
from warchron.model.round import Round, Choice, Battle
|
||||
from warchron.model.war_participant import WarParticipant
|
||||
from warchron.model.objective import Objective
|
||||
from warchron.model.campaign_participant import CampaignParticipant
|
||||
from warchron.model.sector import Sector
|
||||
from warchron.model.campaign import Campaign
|
||||
from warchron.model.round import Round
|
||||
from warchron.model.choice import Choice
|
||||
from warchron.model.battle import Battle
|
||||
|
||||
|
||||
class War:
|
||||
|
|
@ -312,35 +318,3 @@ class War:
|
|||
def remove_battle(self, round_id: str, sector_id: str) -> None:
|
||||
camp = self.get_campaign_by_round(round_id)
|
||||
camp.remove_battle(round_id, sector_id)
|
||||
|
||||
|
||||
class Objective:
|
||||
def __init__(self, name: str, description: str):
|
||||
self.id: str = str(uuid4())
|
||||
self.name: str = name
|
||||
self.description: str = description
|
||||
|
||||
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_description(self, new_description: str) -> None:
|
||||
self.description = new_description
|
||||
|
||||
|
||||
class WarParticipant:
|
||||
def __init__(self, *, player_id: str, faction: str):
|
||||
self.id: str = str(uuid4())
|
||||
self.player_id: str = player_id # ref to WarModel.players
|
||||
self.faction: str = faction
|
||||
|
||||
def set_id(self, new_id: str) -> None:
|
||||
self.id = new_id
|
||||
|
||||
def set_player(self, new_player: str) -> None:
|
||||
self.player_id = new_player
|
||||
|
||||
def set_faction(self, new_faction: str) -> None:
|
||||
self.faction = new_faction
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue