public void AddEdge(GraphVertex target, double distance) { if (target == null) { throw new ArgumentNullException("target"); } if (target == this) { throw new ArgumentException("Current implementation neither expects nor allows Vertices to connect to themselves."); } if (distance < 0) { throw new ArgumentException("Distance must be positive."); } _edges.Add(new GraphEdge(target, distance)); }
public void AddVertex(Vector2 v) { var vertex = new GraphVertex(v); Vertices.Add(v, vertex); }
public GraphEdge(GraphVertex terminator, double weight) { _weight = weight; _terminator = terminator; }