resolve pairing WIP
This commit is contained in:
parent
0c6014e946
commit
241d7f10f5
11 changed files with 302 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
from uuid import uuid4
|
||||
from typing import Any, Dict
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from warchron.model.exception import ForbiddenOperation
|
||||
from warchron.model.choice import Choice
|
||||
|
|
@ -119,6 +119,11 @@ class Round:
|
|||
b.winner_id is not None or b.is_draw() for b in self.battles.values()
|
||||
)
|
||||
|
||||
def get_battles_with_places(self) -> List[Battle]:
|
||||
return [
|
||||
battle for battle in self.battles.values() if battle.get_available_places()
|
||||
]
|
||||
|
||||
def create_battle(self, sector_id: str) -> Battle:
|
||||
if self.is_over:
|
||||
raise ForbiddenOperation("Can't create battle in a closed round.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue