Esempio n. 1
0
 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;
         }
     }
 }
Esempio n. 2
0
 public Edge(Vertex start, Vertex end)
 {
     this.start = start;
     this.end = end;
     color = Color.White;
 }
Esempio n. 3
0
 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];
     }
 }
Esempio n. 4
0
 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];
     }
 }
Esempio n. 5
0
 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);
     }
 }