// // Ariadne.Generator's copy of the scripts in this file: the code that actually runs. Edits here are overwritten. // In the copy beside the script, #line paths are relative to it; the compiled code uses full paths. #pragma warning disable namespace Ariadne.Vellum.UnitTests { partial class RepeatingOperatorScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Run__i; public global::Ariadne.Vellum.UnitTests.PlantScript Run____call_Update_receiver; public global::Ariadne.Vellum.UnitTests.PlantScript.__Frame Run____call_Update_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.i"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.Update/", typeof(global::Ariadne.Vellum.UnitTests.PlantScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.Vellum.UnitTests.PlantScript.__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.CodeDom.Compiler.GeneratedCode("Ariadne.Generator", "1.0")] protected override bool __Resume(global::Ariadne.UnitTests.ArcTests.Gates context, global::Ariadne.TickTime __time) { return Run__Passage((__Frame)__CurrentFrame, __time, context); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } public RepeatingOperatorScript() { } protected RepeatingOperatorScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Plant", out global::Ariadne.Vellum.UnitTests.PlantScript loaded)) { this.Plant = loaded; } else if (!reader.HasField("Plant")) { throw new global::System.IO.InvalidDataException("RepeatingOperatorScript's save has no field 'Plant', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Result", out string loaded)) { this.Result = loaded; } else if (!reader.HasField("Result")) { throw new global::System.IO.InvalidDataException("RepeatingOperatorScript's save has no field 'Result', which has no initializer to fall back on. Give it one."); } } } protected RepeatingOperatorScript(global::Ariadne.IArcReader reader) : this(reader, default(global::Ariadne.AutoLoadEveryField)) { } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private static void __ListParts(global::Ariadne.IArcPartLister lister) { lister.Field("Plant"); lister.Field("Result"); lister.Local("Run.i"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.Update/", typeof(global::Ariadne.Vellum.UnitTests.PlantScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.Vellum.UnitTests.PlantScript.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 8 "RepeatingOperatorScript.cs" writer.Field("Plant", this.Plant); #line 10 "RepeatingOperatorScript.cs" writer.Field("Result", this.Result); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.Update/receiver": #line 16 "RepeatingOperatorScript.cs" writer.Local("receiver", this.Run____call_Update_receiver); #line hidden return; case "Run.i": #line 14 "RepeatingOperatorScript.cs" writer.Local("Run.i", this.Run__i); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Run.i", out int loaded)) { this.Run__i = loaded; } } { if (reader.TryScope("Run.Update/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.Vellum.UnitTests.PlantScript loaded)) { this.Run____call_Update_receiver = loaded; } } if (this.Run____call_Update_receiver != null) { this.Run____call_Update_frame = (global::Ariadne.Vellum.UnitTests.PlantScript.__Frame)this.Run____call_Update_receiver.NewFrame(); this.Run____call_Update_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_Update_frame != null) { this.Run____call_Update_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_Update_frame != null) { this.Run____call_Update_frame.EndWaits(); } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Run__Passage(__Frame __frame, global::Ariadne.TickTime __time, Gates gates) { #line hidden switch (__frame.ResumeKey) { case "Update": goto Update; } #line hidden { ref int i = ref __frame.Run__i; #line 14 "RepeatingOperatorScript.cs" i = 0; #line hidden } #line hidden __loopStart1: #line hidden { ref int i = ref __frame.Run__i; #line 14 "RepeatingOperatorScript.cs" if (!(i < 2)) goto __loopEnd1; #line hidden } #line hidden Update: #line hidden { #line 16 "RepeatingOperatorScript.cs" using (__frame.Enter("Update")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_Update_receiver = (Plant); __frame.Run____call_Update_frame = null; } if (__frame.Run____call_Update_frame == null) { __frame.Run____call_Update_frame = (global::Ariadne.Vellum.UnitTests.PlantScript.__Frame)__frame.Run____call_Update_receiver.NewFrame(); } if (!__frame.Run____call_Update_receiver.Update__Passage(__frame.Lend(__frame.Run____call_Update_frame), __time, gates)) { return false; } } #line 17 "RepeatingOperatorScript.cs" gates.Open.Remove("go"); #line hidden } #line hidden __loopCont1: #line hidden { ref int i = ref __frame.Run__i; #line 14 "RepeatingOperatorScript.cs" i++; #line hidden goto __loopStart1; #line hidden } #line hidden __loopEnd1: #line 20 "RepeatingOperatorScript.cs" Result = "done " + Plant.Updates; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Run__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "Update": __frame.SaveLocal("Run.i", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.Update/"); __frame.SaveLocal("Run.Update/receiver", scope); if (__frame.Run____call_Update_receiver != null) { __frame.Run____call_Update_receiver.Update__LocalsToSave(__frame.Lend(__frame.Run____call_Update_frame), depth + 1, scope); } } break; } } } }