From bc055cda47021daa7220820ed4825f83ab1cc0ee Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 4 Jun 2015 03:07:31 +0100 Subject: implement a way to view the black card Signed-off-by: Olivier Gayot --- CAO_Client.py | 5 +++++ CAO_Game.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/CAO_Client.py b/CAO_Client.py index 3132e57..67ce54f 100644 --- a/CAO_Client.py +++ b/CAO_Client.py @@ -47,3 +47,8 @@ class CAO_Client(): if self.game is None: return cao_error('You have to join a game first') return self.game.try_view_played_cards(self.player) + + def view_black_card(self): + if self.game is None: + return cao_error('You have to join a game first') + return self.game.try_view_black_card(self.player) diff --git a/CAO_Game.py b/CAO_Game.py index ed446ee..54bbf48 100644 --- a/CAO_Game.py +++ b/CAO_Game.py @@ -149,3 +149,9 @@ class CAO_Game(): cards.append(self.white_desc[card]) return cao_success(cards) + + def try_view_black_card(self, player): + card = self.board.current_black_card + + if card is not None: + return cao_success(self.black_desc[card]) -- cgit v1.2.3