Exemplo n.º 1
0
    def _get_neighbor_passables(self, direction):
        upper_left_dir = anticlockwise_45(direction)
        upper_right_dir = clockwise_45(direction)

        forward = self._passable(direction)
        left = self._passable(anticlockwise(direction))
        right = self._passable(clockwise(direction))
        up_left = self._passable(upper_left_dir)
        down_left = self._passable(anticlockwise(upper_left_dir))
        up_right = self._passable(upper_right_dir)
        down_right = self._passable(clockwise(upper_right_dir))
        return forward, up_left, up_right, left, right, down_left, down_right
Exemplo n.º 2
0
    def _get_neighbor_passables(self, direction):
            upper_left_dir = anticlockwise_45(direction)
            upper_right_dir = clockwise_45(direction)

            forward = self._passable(direction)
            left = self._passable(anticlockwise(direction))
            right = self._passable(clockwise(direction))
            up_left = self._passable(upper_left_dir)
            down_left = self._passable(anticlockwise(upper_left_dir))
            up_right = self._passable(upper_right_dir)
            down_right = self._passable(clockwise(upper_right_dir))
            return forward, up_left, up_right, left, right, down_left, down_right
Exemplo n.º 3
0
 def _get_side_passables(self, direction):
     if direction in Dir.Orthogonals:
         left = self._passable(anticlockwise(direction))
         right = self._passable(clockwise(direction))
     elif direction in Dir.Diagonals:
         left = self._passable(anticlockwise_45(direction))
         right = self._passable(clockwise_45(direction))
     else:
         raise Exception("Not a valid direction: {0}".format(direction))
     return WalkType(left, right)
Exemplo n.º 4
0
 def _get_side_passables(self, direction):
     if direction in Dir.Orthogonals:
         left = self._passable(anticlockwise(direction))
         right = self._passable(clockwise(direction))
     elif direction in Dir.Diagonals:
         left = self._passable(anticlockwise_45(direction))
         right = self._passable(clockwise_45(direction))
     else:
         raise Exception("Not a valid direction: {0}".format(direction))
     return WalkType(left, right)