summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-04 23:21:40 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-06-04 23:21:40 +0100
commit1cf99f4b45ae926052af21a7fe9c47bccfda5c91 (patch)
tree961693bb20afacd569dce3d4ec3ff3c7d6d093e8
parent51746b6bdd5239fef4667b6f8ff4413fd60597f2 (diff)
standardize the notifications
use a proper syntax with opcode and no spaces in names Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
-rw-r--r--CAO_Game.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/CAO_Game.py b/CAO_Game.py
index d46bb3b..a77b376 100644
--- a/CAO_Game.py
+++ b/CAO_Game.py
@@ -50,7 +50,7 @@ class CAO_Game():
for p in self.players:
if p is not player:
- p.send_notification('somebody has joined the game')
+ p.send_notification({'op': 'player_joined_game'})
return self.try_view_player_cards(player)
@@ -67,7 +67,7 @@ class CAO_Game():
for p in self.players:
if p is not player:
- p.send_notification('a judge has been designed')
+ p.send_notification({'op': 'judge_designed'})
return self.try_view_black_card(player)
@@ -90,7 +90,7 @@ class CAO_Game():
self.board.play_card(player, card)
- self.judge.send_notification('somebody played a card')
+ self.judge.send_notification({'op': 'card_played'})
return cao_success({'card_id': card_id})
@@ -109,7 +109,7 @@ class CAO_Game():
for p in self.players:
if p is not player:
- p.send_notification('somebody collected the cards')
+ p.send_notification({'op': 'cards_collected'})
return self.try_view_played_cards(player)
@@ -148,7 +148,7 @@ class CAO_Game():
for p in self.players:
if p is not player:
- p.send_notification('we need a new judge')
+ p.send_notification({'op': 'judge_needed'})
self.state = self.WAITING_NEW_JUDGE