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; }
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; }
public void removeNeighbor(Node node) { this.neighbors.Remove(this.neighbors.Find(o => o.neighbor == node)); }
public bool hasNeighbor(Node node) { return this.neighbors.Find(o => o.neighbor == node) != null; }
public Connection getNeighbor(Node node) { return this.neighbors.Find(o => o.neighbor == node); }
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)); }