samples/13_path_finding_algorithms/08_a_star/app/main.rb
# Moves the target to the grid closest to the mouse in the first grid
# Only reset_searchess the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
Moves the target to the grid closest to the mouse in the first grid
Only reset_searchess the search if the target changes position
Called whenever the user is editing the target (puts mouse down on target)
Moves the target to the grid closest to the mouse in the first grid Only reset_searchess the search if the target changes position Called whenever the user is editing the target ( puts mouse down on target )
def process_input_dijkstra_target
    old_target = grid.target.clone
    unless dijkstra_cell_closest_to_mouse == grid.star
      grid.target = dijkstra_cell_closest_to_mouse
    end
    unless old_target == grid.target
      reset_searches
    end
  end
def process_input_dijkstra_target old_target = grid . target . clone unless dijkstra_cell_closest_to_mouse == grid . star grid . target = dijkstra_cell_closest_to_mouse end unless old_target == grid . target reset_searches end end
Moves the target to the grid closest to the mouse in the first grid
Only reset_searchess the search if the target changes position
Called whenever the user is editing the target (puts mouse down on target)
Moves the target to the grid closest to the mouse in the first grid Only reset_searchess the search if the target changes position Called whenever the user is editing the target ( puts mouse down on target )