summaryrefslogtreecommitdiff
path: root/CAO_Client.py
diff options
context:
space:
mode:
Diffstat (limited to 'CAO_Client.py')
-rw-r--r--CAO_Client.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/CAO_Client.py b/CAO_Client.py
index daf6f7e..3132e57 100644
--- a/CAO_Client.py
+++ b/CAO_Client.py
@@ -1,3 +1,4 @@
+from CAO_Status import cao_error
from CAO_Game import CAO_Game
class CAO_Client():
@@ -9,7 +10,7 @@ class CAO_Client():
def join_game(self, game_name):
if self.game is not None:
- return ('ERR', 'You are already in a game')
+ return cao_error('You are already in a game')
self.game = self.game_manager.join_game(game_name)
return self.game.try_join(self)
@@ -19,30 +20,30 @@ class CAO_Client():
def play_white_card(self, card_id):
if self.game is None:
- return ('ERR', 'You have to join a game first')
+ return cao_error('You have to join a game first')
return self.game.try_play_card(self.player, card_id)
def pick_black_card(self):
if self.game is None:
- return ('ERR', 'You have to join a game first')
+ return cao_error('You have to join a game first')
return self.game.try_become_judge(self.player)
def collect_cards(self):
if self.game is None:
- return ('ERR', 'You have to join a game first')
+ cao_error('You have to join a game first')
return self.game.try_collect_cards(self.player)
def designate_card(self, card_id):
if self.game is None:
- return ('ERR', 'You have to join a game first')
+ return cao_error('You have to join a game first')
return self.game.try_designate_card(self.player, card_id)
def view_player_cards(self):
if self.game is None:
- return ('ERR', 'You have to join a game first')
+ return cao_error('You have to join a game first')
return self.game.try_view_player_cards(self.player)
def view_played_cards(self):
if self.game is None:
- return ('ERR', 'You have to join a game first')
+ return cao_error('You have to join a game first')
return self.game.try_view_played_cards(self.player)