def _by_pass_direction_is_possible(self, direction): if direction not in self._directions_tested: try_position = get_position_with_direction_decal(direction, self._host.get_position()) if try_position not in self.get_memory_since_blocked() and self._feeler.direction_is_free(direction): return True return False
def direction_is_free(self, direction): position = self._host.get_position() will_position = get_position_with_direction_decal(direction, position) return self._grid.is_free(will_position)