Esempio n. 1
0
 public Node(Node n)
     : base(n.z)
 {
     this.rect = n.rect;
     this.weight = n.z;
     this.parent = null;
     this.children = null;
     this.color = n.color;
 }
Esempio n. 2
0
 public Node(Color color, int x, int y, int z)
     : base(z)
 {
     this.rect = new Rectangle();
     rect.X = x;
     rect.Y = y;
     rect.Width = 1;
     rect.Height = 1;
     this.weight = 1;
     this.parent = null;
     this.color = color;
 }
Esempio n. 3
0
 public void removeNeighbor(Node node)
 {
     this.neighbors.Remove(this.neighbors.Find(o => o.neighbor == node));
 }
Esempio n. 4
0
 public bool hasNeighbor(Node node)
 {
     return this.neighbors.Find(o => o.neighbor == node) != null;
 }
Esempio n. 5
0
 public Connection getNeighbor(Node node)
 {
     return this.neighbors.Find(o => o.neighbor == node);
 }
Esempio n. 6
0
 public void addNeighbor(Node node, SpecialConnection settings = null, bool possibleDuplicate = false)
 {
     if (!possibleDuplicate && this.neighbors.Find(o => o.neighbor == node) != null) {
         throw new Exception("");
     }
     this.neighbors.Add(new Connection(node, settings));
 }