public void AddEdge(int from, int to, int weight = 1) { if (from < 0 || from > CurrGraph.Nodes.Count || to < 0 || to > CurrGraph.Nodes.Count) { throw new ArgumentOutOfRangeException(); } CurrGraph.AddConnection(from, to, weight); }
public void RemoveEdge(int from, int to) { if (from < 0 || from > CurrGraph.Nodes.Count || to < 0 || to > CurrGraph.Nodes.Count) { throw new ArgumentOutOfRangeException(); } CurrGraph.RemoveConnection(from, to); }
public void AddNode(float x, float y) { if (x < 0 || x > Width || y < 0 || y > Height) { throw new ArgumentOutOfRangeException(); } CurrGraph.AddDrawableNode(x, y, Radius); }