-
Notifications
You must be signed in to change notification settings - Fork 0
/
tile.py
34 lines (25 loc) · 837 Bytes
/
tile.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
class Tile:
def __init__(self, x, y, tile_type):
self.__x = x
self.__y = y
self.__tile_type = tile_type
self.__direction_number = None
self.__is_path = False
def get_coordinates(self):
return self.__x, self.__y
def get_is_empty(self):
return self.__tile_type == 0
def get_is_wall(self):
return self.__tile_type == 1
def get_is_goal(self):
return self.__tile_type == 2
def get_is_walkable(self):
return self.get_is_empty() or self.get_is_goal()
def get_direction_number(self):
return self.__direction_number
def set_direction_number(self, value):
self.__direction_number = value
def get_is_path(self):
return self.__is_path
def set_is_path(self, value):
self.__is_path = value