summaryrefslogtreecommitdiff
path: root/swiftstory/game.py
diff options
context:
space:
mode:
Diffstat (limited to 'swiftstory/game.py')
-rw-r--r--swiftstory/game.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/swiftstory/game.py b/swiftstory/game.py
index cda3ddd..20ac726 100644
--- a/swiftstory/game.py
+++ b/swiftstory/game.py
@@ -1,4 +1,5 @@
import random
+from typing import Optional
from swiftstory.exception import WrongAction, JoinError
from swiftstory.player import Player
@@ -19,7 +20,7 @@ class Game:
self.players = []
- self.judge = None
+ self.judge: Optional[Player] = None
self.board = Board()
self.board.white_pick = white_pick
@@ -101,6 +102,8 @@ class Game:
self.board.play_card(player, card)
+ if self.judge is None:
+ raise ValueError("There is no judge")
self.judge.register_notification({'op': 'card_played'})
return success({'card_id': card_id})