2using System.Collections.Generic;
4using System.Threading.Tasks;
35 public override async Task
FromXml(XmlElement Definition)
39 List<ISimulationNode>
Children =
new List<ISimulationNode>();
41 if (!(this.children is
null))
44 foreach (XmlNode N
in Definition.ChildNodes)
46 if (N is XmlElement E)
62 if (this.children is
null)
66 int c = this.children.Length;
68 this.children[c] = Child;
87 if (!(this.children is
null))
90 await Child.
ForEach(Method, DepthFirst);
103 if (!(this.children is
null))
116 if (!(this.children is
null))
Factory of simulation objects.
static async Task< ISimulationNode > Create(XmlElement Definition, ISimulationNode Parent, Model Model)
Creates a simulation objected, based on its XML definition.
Root node of a simulation model
Abstract base class for simulation nodes with children
override async Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
override async Task ForEach(ForEachCallbackMethod Method, bool DepthFirst)
Evaluates Method on each node in the subtree defined by the current node.
override async Task ExportXml(XmlWriter Output)
Exports XML
ISimulationNode[] Children
Child nodes.
void AddChild(ISimulationNode Child)
Adds a child node.
override async Task ExportMarkdown(StreamWriter Output)
Exports Markdown
virtual bool ParseChildren
If children are to be parsed by FromXml(XmlElement)
SimulationNodeChildren(ISimulationNode Parent, Model Model)
Abstract base class for simulation nodes
Abstract base class for simulation nodes
ISimulationNode Parent
Parent node in the simulation model.
Basic interface for simulator nodes with child nodes.
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
Task ForEach(ForEachCallbackMethod Method, bool DepthFirst)
Evaluates Method on each node in the subtree defined by the current node.
Task ExportMarkdown(StreamWriter Output)
Exports Markdown
Task ExportXml(XmlWriter Output)
Exports XML
delegate Task ForEachCallbackMethod(ISimulationNode Node)
Callback method for iteration across the simulation model.