-
Notifications
You must be signed in to change notification settings - Fork 0
/
Decks.py
39 lines (27 loc) · 869 Bytes
/
Decks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import GameMechanics
from random import shuffle
class Deck:
deck = []
def __init__(self):
all_cards = GameMechanics.Stats().all_cards
for type in ["string", "action"]:
for card in all_cards[type].keys():
for num_cards in range(all_cards[type][card]):
self.deck.append(card)
def shuffle_deck(self):
shuffle(self.deck)
def draw_card(self):
return self.deck.pop(0)
class Goals:
deck = []
current = 0
def __init__(self):
goal_cards = GameMechanics.Stats().all_cards["goals"]
for card in goal_cards.keys():
self.deck.append(card)
deck = shuffle(self.deck)
def current_goal(self):
return self.deck[self.current]
def next_goal(self):
self.current_goal += 1
return self.deck[self.current]