def get_string_options(self, string_option_type):
if string_option_type == 'direction':
- return self.map_geometry.get_directions()
+ return self.map_geometry.directions
elif string_option_type == 'char':
return [c for c in
string.digits + string.ascii_letters + string.punctuation + ' ']
def __init__(self, size):
self.size = size
self.neighbors_i = {}
+ self.directions = self.get_directions()
def get_directions(self):
directions = []
def get_neighbors_yxyx(self, yxyx):
neighbors = {}
- for direction in self.get_directions():
+ for direction in self.directions:
neighbors[direction] = self.move_yxyx(yxyx, direction)
return neighbors
def get_neighbors_yx(self, pos):
neighbors = {}
- for direction in self.get_directions():
+ for direction in self.directions:
neighbors[direction] = self.move_yx(pos, direction)
return neighbors