private void ConnectConsumerToDepot(Node node1, Node node2, Color connectionColor) { if (node1.Type != Node.NodeType.Depot) { node1.ConnectTo(node2, connectionColor); } else { node2.ConnectTo(node1, connectionColor); } }
public override void DrawNodes() { List<Node> drawingNodes = new List<Node>(); for (int i = 0; i != Clusters.Count; i++) { Cluster cluster = Clusters[i]; if (cluster.Nodes.Count == 0) { continue; } Node center = new Node(-1, Node.NodeType.Auxiliary, (int)Clusters[i].Center.x, (int)Clusters[i].Center.y, Clusters[i].Center.x, Clusters[i].Center.y); if (cluster.Nodes.Count == 0) { drawingNodes.Add(center); continue; } foreach (Node node in cluster.Nodes) { center.ConnectTo(node, Color.LightGray); drawingNodes.Add(node); } drawingNodes.Add(center); } Node depot = Clusters[0].Depot; if (depot != null) { drawingNodes.Add(depot); } TaskController.DrawNodes(drawingNodes); }
public List<Node> GetDrawingNodes(Color connectionsColor) { List<Node> drawingNodes = new List<Node>(); if (Nodes.Count == 0) { return drawingNodes; } Node center = new Node(-1, Node.NodeType.Auxiliary, (int)Center.x, (int)Center.y, Center.x, Center.y); foreach (Node node in Nodes) { center.ConnectTo(node, connectionsColor); drawingNodes.Add(node); } drawingNodes.Add(center); return drawingNodes; }