-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcard.py
49 lines (37 loc) · 1.09 KB
/
card.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
import enum
class Card(object):
def __init__(self, name, age, min_players, bonus, cost=None, parents=None, children=None):
self.name = name
self.age = age
self.min_players = int(min_players)
self.bonus = bonus
self.cost = cost if isinstance(cost, dict) else {}
self.parents = parents if isinstance(parents, list) else []
self.children = children if isinstance(children, list) else []
def __eq__(self, other):
return self.__dict__ == other.__dict__
def __str__(self):
return self.__class__.__name__ + ': ' + str(self.__dict__)
def __repr__(self):
return '<' + str(self) + '>'
class BasicResourceCard(Card):
"""Brown resource card for raw materials."""
pass
class AdvResourceCard(Card):
"""Gray resource card for manufactured goods."""
pass
class ScienceCard(Card):
"""Green science card."""
pass
class MilitaryCard(Card):
"""Red military card."""
pass
class CivilCard(Card):
"""Blue civilian structures card."""
pass
class CommerceCard(Card):
"""Yellow commerce card."""
pass
class GuildCard(Card):
"""Purple guild card."""
pass