Method: Map#add_new_adjacent

Defined in:
lib/map/map.rb

#add_new_adjacent(point, newAdjacent) ⇒ Object

Adds a new adjacent to point only if it belongs to the map



93
94
95
96
97
98
# File 'lib/map/map.rb', line 93

def add_new_adjacent(point, newAdjacent)
  if((@map_nodes[point] != nil) && !(is_adjacent?(point, newAdjacent)) && (@map_nodes[newAdjacent] != nil))
    @adjacencies[point] << newAdjacent
    @adjacencies[newAdjacent] << point
  end 
end