-
Notifications
You must be signed in to change notification settings - Fork 0
/
cells.py
84 lines (62 loc) · 1.52 KB
/
cells.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import random
from colors import Colors
class Cell:
def __init__(self):
self.rect = [0, 0, 0, 0]
def as_owner(self, player):
pass
def as_visitor(self, player):
pass
def as_client(self, player):
pass
class PropertyCell(Cell):
COLORS = [
Colors.BROWN,
Colors.LBLUE,
Colors.PINK,
Colors.ORANGE,
Colors.RED,
Colors.YELLOW,
Colors.GREEN,
Colors.BLUE
]
def __init__(self, color, name):
self.color = color
self.name = name
self.owner = None
self.owner = random.randint(-1, 7)
if self.owner == -1: self.owner = None
self.mortgaged = False
self.houses = 0
self.hotel = False
def get_color(self):
return PropertyCell.COLORS[self.color]
def get_houses(self):
return self.houses
def has_hotel(self):
return self.hotel
class SpecialPropertyCell(PropertyCell):
def __init__(self, name):
super().__init__(-1, name)
self.houses = -1
def get_color(self):
return (0,0,0)
class RailroadCell(SpecialPropertyCell):
pass
class CompanyCell(SpecialPropertyCell):
pass
class TaxCell(Cell):
def __init__(self, amount):
self.amount = amount
class StartCell(Cell):
pass
class CommunityChestCell(Cell):
pass
class ChanceCell(Cell):
pass
class JailCell(Cell):
pass
class ParkingCell(Cell):
pass
class GoToJailCell(Cell):
pass