-
Notifications
You must be signed in to change notification settings - Fork 0
/
block.py
31 lines (24 loc) · 906 Bytes
/
block.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
class Block:
def __init__(self, possible_tiles, coord, tile = None):
self._coord = coord
self._tile = tile
# TODO: initialize this to the set of all tiles once that is implemented
self._possible_tiles = possible_tiles
# Check if block is tiled
def is_tiled(self):
return self._tile != None
# Returns number of possible tiles in current block
def num_possible_tiles(self):
return len(self._possible_tiles)
# Getters and setters
def get_tile(self):
return self._tile
def set_tile(self, tile):
self._tile = tile
def get_coord(self):
return self._coord
def get_possible_tiles(self):
return self._possible_tiles
def set_possible_tiles(self, possible_tiles):
# TODO: recursion here!! otherwise possible tiles will not be valid
self._possible_tiles = possible_tiles