summaryrefslogtreecommitdiff
path: root/swiftstory/Player.py
diff options
context:
space:
mode:
Diffstat (limited to 'swiftstory/Player.py')
-rw-r--r--swiftstory/Player.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/swiftstory/Player.py b/swiftstory/Player.py
deleted file mode 100644
index 7193b64..0000000
--- a/swiftstory/Player.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import json
-
-
-class 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 inc_score(self):
- self.score += 1
- self.register_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 register_notification(self, obj):
- if self.client is None:
- return
-
- message = json.dumps({'type': 'notification', 'content': obj})
-
- self.client.register_notification(message)