lib/strategy_game_backend/map.rb
# We only want to return actual traversable unit types when the terrain has
# been explored by the player, so if it is not explored yet, we'll return
# all options, and we will use the path finding when moving to determine where
# we have to stop.
We only want to return actual traversable unit types when the terrain has
been explored by the player, so if it is not explored yet, we'll return
all options, and we will use the path finding when moving to determine where
we have to stop.
We only want to return actual traversable unit types when the terrain has been explored by the player so if it is not explored yet we ' ll return all options and we will use the path finding when moving to determine where we have to stop .
def traversable_by(x, y)
        if explored?(x, y)
          if within_water_area?(x, y)
            %i[sea air]
          elsif within_obstacle_area?(x, y)
            [:air]
          else
            %i[land air]
          end
        else
          %i[land sea air]
        end
      end
def traversable_by ( x , y ) if explored? ( x , y ) if within_water_area? ( x , y ) %i[ sea air ] elsif within_obstacle_area? ( x , y ) [ :air ] else %i[ land air ] end else %i[ land sea air ] end end
We only want to return actual traversable unit types when the terrain has
been explored by the player, so if it is not explored yet, we'll return
all options, and we will use the path finding when moving to determine where
we have to stop.
We only want to return actual traversable unit types when the terrain has been explored by the player so if it is not explored yet we ' ll return all options and we will use the path finding when moving to determine where we have to stop .
x
y