summaryrefslogtreecommitdiff
path: root/swiftstory/player.py
diff options
context:
space:
mode:
Diffstat (limited to 'swiftstory/player.py')
-rw-r--r--swiftstory/player.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/swiftstory/player.py b/swiftstory/player.py
index 011ae51..525a4e6 100644
--- a/swiftstory/player.py
+++ b/swiftstory/player.py
@@ -1,11 +1,11 @@
import asyncio
import json
-from typing import Any
+from typing import Any, Dict, Tuple
class Player:
- def __init__(self):
- self.cards = {}
+ def __init__(self) -> None:
+ self.cards: Dict[int, Tuple[int, str]] = {}
self.next_idx = 0
self.score = 0
@@ -15,17 +15,17 @@ class Player:
self.name = 'default'
self.notifications: asyncio.Queue = asyncio.Queue()
- def pop_card(self, card_id):
+ def pop_card(self, card_id: int) -> Tuple[int, str]:
return self.cards.pop(card_id)
- def inc_score(self):
+ def inc_score(self) -> None:
self.score += 1
self.register_notification({
'op': 'updated_score',
'content': self.score,
})
- def receive_card(self, card):
+ def receive_card(self, card: Tuple[int, str]) -> int:
self.cards[self.next_idx] = card
self.next_idx += 1
return self.next_idx - 1