-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgameboard.py
52 lines (34 loc) · 1.12 KB
/
gameboard.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
40
41
42
43
44
45
46
47
48
49
50
51
import random
class CardContainer(list):
def __repr__(self):
if not len(self):
return '[Empty]'
return '[<%s>]' % '>, <'.join(['%s' % item for item in self])
class Deck(CardContainer):
def shuffle(self):
random.shuffle(self)
@staticmethod
def generate_deck():
from cards.lands.basic_lands import BasicMountain, BasicPlains
from cards.instants import WarReport
from cards.creatures import AngelicOverseer, GoblinCavaliers, GoblinDeathraiders
curr_deck = Deck()
for i in range(10):
curr_deck.append(BasicMountain())
curr_deck.append(BasicPlains())
for i in range(3):
curr_deck.append(AngelicOverseer())
for i in range(3):
curr_deck.append(GoblinCavaliers())
for i in range(3):
curr_deck.append(GoblinDeathraiders())
for i in range(3):
curr_deck.append(WarReport())
curr_deck.shuffle()
return curr_deck
class Hand(CardContainer):
pass
class Battlefield(CardContainer):
pass
class Graveyard(CardContainer):
pass