summaryrefslogtreecommitdiff
path: root/CAO_Player.py
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-06-14 22:31:48 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-06-14 22:37:40 +0100
commit0fb08748e5285e5d4adc6135eec8889887a63299 (patch)
tree3a82c2899f33a8d4234b07799cff00865c8e141c /CAO_Player.py
parentad12c67adcc8e3c0f29814b1b95959ac4b9f4a4d (diff)
use a python package instead of just modules
The package is contained in the CAO/ folder. server.py is still at the root of the repository though. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'CAO_Player.py')
-rw-r--r--CAO_Player.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/CAO_Player.py b/CAO_Player.py
deleted file mode 100644
index d08a0a1..0000000
--- a/CAO_Player.py
+++ /dev/null
@@ -1,43 +0,0 @@
-import json
-
-class CAO_Player():
- def __init__(self, client):
- self.cards = {}
- self.next_idx = 0
-
- self.client = client
-
- self.score = 0
-
- self.has_played = False
-
- self.name = 'default'
-
- def pop_card(self, card_id):
- return self.cards.pop(card_id)
-
- def get_has_played(self):
- return self.has_played
-
- def set_has_played(self, has=True):
- self.has_played = has
-
- def inc_score(self):
- self.score += 1
- self.send_notification({
- 'op': 'updated_score',
- 'content': self.score,
- })
-
- 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:
- return
-
- message = json.dumps({'type': 'notification', 'content': obj})
-
- self.client.send_notification(message)