void CreateEdge() { if (!edging) { edging = true; if (from == null) { from = this; } else if (from == this) { return; } else { to = this; parent.createEdge(from, to); to = null; from.focused = true; from = null; } } }
public Edge(Vertex start, Vertex end) { this.start = start; this.end = end; color = Color.White; }
public Vertex createVertex(Vertex vertex) { Vertex clone = new Vertex(this, vertex.position); if (!vertices.Contains(clone)) { vertices.Add(clone); return clone; } else { int i = vertices.IndexOf(clone); return vertices[i]; } }
public Vertex loadVertex(int X, int Y) { Vertex clone = new Vertex(this, new Point (X, Y)); if (!vertices.Contains(clone)) { vertices.Add(clone); return clone; } else { int i = vertices.IndexOf(clone); return vertices[i]; } }
public void createEdge(Vertex start, Vertex end) { Edge edge = new Edge(start, end); bool added = edges.Add(edge); // Remove edge if it already exists if (!added) { edges.Remove(edge); } }