fix participants in round choices + battles
This commit is contained in:
parent
47b01e0b69
commit
7210ddc927
2 changed files with 32 additions and 19 deletions
|
|
@ -189,6 +189,9 @@ class Model:
|
|||
return part
|
||||
raise KeyError("Participant not found")
|
||||
|
||||
def get_player_from_war_participant(self, war_part: WarParticipant) -> Player:
|
||||
return self.get_player(war_part.player_id)
|
||||
|
||||
def update_war_participant(self, participant_id: str, *, faction: str):
|
||||
war = self.get_war_by_war_participant(participant_id)
|
||||
war.update_war_participant(participant_id, faction=faction)
|
||||
|
|
@ -314,6 +317,12 @@ class Model:
|
|||
return part
|
||||
raise KeyError("Participant not found")
|
||||
|
||||
def get_player_from_campaign_participant(
|
||||
self, camp_part: CampaignParticipant
|
||||
) -> Player:
|
||||
war_part = self.get_war_participant(camp_part.war_participant_id)
|
||||
return self.get_player(war_part.player_id)
|
||||
|
||||
def update_campaign_participant(
|
||||
self,
|
||||
participant_id: str,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue