diff options
-rw-r--r-- | CAO_Game.py | 12 | ||||
-rw-r--r-- | CAO_Player.py | 1 |
2 files changed, 12 insertions, 1 deletions
diff --git a/CAO_Game.py b/CAO_Game.py index a77b376..27a5567 100644 --- a/CAO_Game.py +++ b/CAO_Game.py @@ -140,7 +140,17 @@ class CAO_Game(): # reset the state of the players for p in self.players: if p.get_has_played: - p.receive_card(self.board.pick_white_card()) + idx = p.receive_card(self.board.pick_white_card()) + card_idx = p.cards[idx] + card_desc = self.white_desc[card_idx] + + p.send_notification({ + 'op': 'received_card', + 'card': { + 'id': idx, + 'desc': card_desc, + }, + }) p.set_has_played(False) self.board.recycle_black_card() diff --git a/CAO_Player.py b/CAO_Player.py index a4dc326..91e6351 100644 --- a/CAO_Player.py +++ b/CAO_Player.py @@ -28,6 +28,7 @@ class CAO_Player(): def receive_card(self, card): self.cards[self.next_idx] = card self.next_idx += 1 + return self.next_idx - 1 def send_notification(self, obj): if self.client is None: |