public void RemoveArc(PathNode node1, PathNode node2) { PathArc arc = GetArc(node1, node2); node1.Arcs.Remove(arc); node2.Arcs.Remove(arc); }
public PathArc GetArc(PathNode node1, PathNode node2) { for (int i = 0; i < node1.Arcs.Count; i++) { PathArc arc = node1.Arcs[i]; if (arc.Node1 == node2 || arc.Node2 == node2) { return(arc); } } return(INVALID_ARC); }
public void AddArc(PathNode node1, PathNode node2) { PathArc arc = new PathArc(node1, node2, _mobilityTypes.Count); node1.Arcs.Add(arc); node2.Arcs.Add(arc); // Compute the arc's traversal time for each MobilityType foreach (MobilityData mobility in _mobilityTypes) { arc.Time[mobility.Index] = Pathfinder.FindLocalPath(this, Position(node1), Position(node2), mobility, 0f); } }