detect and resolve battle tie with influence_token
This commit is contained in:
parent
115ddf8d50
commit
818d2886f4
23 changed files with 808 additions and 172 deletions
40
src/warchron/view/tie_dialog.py
Normal file
40
src/warchron/view/tie_dialog.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
from typing import List, Dict
|
||||
|
||||
from PyQt6.QtWidgets import QWidget, QDialog
|
||||
|
||||
from warchron.constants import Icons, IconName
|
||||
from warchron.controller.dtos import ParticipantOption
|
||||
from warchron.view.ui.ui_tie_dialog import Ui_tieDialog
|
||||
|
||||
|
||||
class TieDialog(QDialog):
|
||||
def __init__(
|
||||
self,
|
||||
parent: QWidget | None = None,
|
||||
*,
|
||||
players: List[ParticipantOption],
|
||||
counters: List[int],
|
||||
context_id: str,
|
||||
) -> None:
|
||||
super().__init__(parent)
|
||||
self._context_id = context_id
|
||||
self._p1_id = players[0].id
|
||||
self._p2_id = players[1].id
|
||||
self.ui: Ui_tieDialog = Ui_tieDialog()
|
||||
self.ui.setupUi(self) # type: ignore
|
||||
self.ui.tieContext.setText("Battle tie") # Change with context
|
||||
self.ui.groupBox_1.setTitle(players[0].name)
|
||||
self.ui.groupBox_2.setTitle(players[1].name)
|
||||
self.ui.tokenCount_1.setText(str(counters[0]))
|
||||
self.ui.tokenCount_2.setText(str(counters[1]))
|
||||
if counters[0] < 1:
|
||||
self.ui.tokenSpend_1.setDisabled(True)
|
||||
if counters[1] < 1:
|
||||
self.ui.tokenSpend_2.setDisabled(True)
|
||||
self.setWindowIcon(Icons.get(IconName.WARCHRON))
|
||||
|
||||
def get_bids(self) -> Dict[str, bool]:
|
||||
return {
|
||||
self._p1_id: self.ui.tokenSpend_1.isChecked(),
|
||||
self._p2_id: self.ui.tokenSpend_2.isChecked(),
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue