/// <summary> /// Updates each PowerLines of the grid (not implemented). /// </summary> private void UpdateAllPowerLine() { foreach (PowerLine PowerLine in List_PowerLine) { PowerLine.Update(TimePassed); } }
protected void AddOutput(Node linkedNode, PowerLine powerLine) { if (Dictionary_Input.Count < MaxInput && !Dictionary_Input.ContainsKey(linkedNode)) { Dictionary_Input.Add(linkedNode, powerLine); linkedNode.AddInput(this, powerLine); } }
/// <summary> /// Add an output Node to the selected Node and create a PowerLine with the stated max load linking the two. /// The output Node will also have the selected Node added as an input. /// Skipped if the two Nodes are already linked. /// </summary> public void AddOutput(Node linkedNode, int powerLineMaxLoad) { if (Dictionary_Output.Count < MaxOutput && !Dictionary_Output.ContainsKey(linkedNode)) { PowerLine PowerLine = new PowerLine(powerLineMaxLoad, linkedNode.Location, this.Location); Dictionary_Output.Add(linkedNode, PowerLine); linkedNode.AddInput(this, PowerLine); } }