internal override Node ShallowClone(Node replace, int pos) { var cnode = new TSystem(this, true); var occurs = 0; cnode.Inputs = new ImmutableCollection <Param>(CloneCollection <Param>(inputs, replace, pos, ref occurs, out cnode.inputs)); cnode.Outputs = new ImmutableCollection <Param>(CloneCollection <Param>(outputs, replace, pos, ref occurs, out cnode.outputs)); cnode.Config = CloneField <Config>(Config, replace, pos, ref occurs); cnode.Steps = new ImmutableCollection <Step>(CloneCollection <Step>(steps, replace, pos, ref occurs, out cnode.steps)); return(cnode); }
internal override Node DeepClone(IEnumerable <Node> clonedChildren, bool keepCompilerData) { var cnode = new TSystem(this, keepCompilerData); cnode.cachedHashCode = this.cachedHashCode; using (var cenum = clonedChildren.GetEnumerator()) { cnode.Inputs = new ImmutableCollection <Param>(TakeClones <Param>(inputs.Count, cenum, out cnode.inputs)); cnode.Outputs = new ImmutableCollection <Param>(TakeClones <Param>(outputs.Count, cenum, out cnode.outputs)); cnode.Config = TakeClone <Config>(cenum); cnode.Steps = new ImmutableCollection <Step>(TakeClones <Step>(steps.Count, cenum, out cnode.steps)); } return(cnode); }
private TSystem(TSystem n, bool keepCompilerData) : base(n.Span) { Name = n.Name; CompilerData = keepCompilerData ? n.CompilerData : null; }