// // 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 using System.Collections.Generic; using Ariadne.UnitTests; namespace Ariadne.Vellum.UnitTests { partial class CountingScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Run__waits; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.waits"); } } [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 CountingScript() { } protected CountingScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Count", out int loaded)) { this.Count = loaded; } } { if (reader.TryField("Note", out string loaded)) { this.Note = loaded; } } } protected CountingScript(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("Count"); lister.Field("Note"); lister.Local("Run.waits"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 11 "TestScripts.cs" writer.Field("Count", this.Count); #line 13 "TestScripts.cs" writer.Field("Note", this.Note); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.waits": #line 17 "TestScripts.cs" writer.Local("Run.waits", this.Run__waits); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Run.waits", out int loaded)) { this.Run__waits = loaded; } } } } #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 ref int waits = ref __frame.Run__waits; switch (__frame.ResumeKey) { case "wait": goto wait; } #line 17 "TestScripts.cs" waits = 0; #line hidden wait: #line 20 "TestScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 22 "TestScripts.cs" Count++; #line 23 "TestScripts.cs" waits++; #line 24 "TestScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 27 "TestScripts.cs" Note = "waited " + waits; #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 "wait": __frame.SaveLocal("Run.waits", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class SharingScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::System.Collections.Generic.List Run__kept; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local>("Run.kept"); } } [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 SharingScript() { } protected SharingScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField>("Route", out global::System.Collections.Generic.List loaded)) { this.Route = loaded; } } { if (reader.TryField>("Remembered", out global::System.Collections.Generic.List loaded)) { this.Remembered = loaded; } else if (!reader.HasField("Remembered")) { throw new global::System.IO.InvalidDataException("SharingScript's save has no field 'Remembered', which has no initializer to fall back on. Give it one."); } } } protected SharingScript(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>("Route"); lister.Field>("Remembered"); lister.Local>("Run.kept"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 36 "TestScripts.cs" writer.Field>("Route", this.Route); #line 38 "TestScripts.cs" writer.Field>("Remembered", this.Remembered); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.kept": #line 42 "TestScripts.cs" writer.Local>("Run.kept", this.Run__kept); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal>("Run.kept", out global::System.Collections.Generic.List loaded)) { this.Run__kept = loaded; } } } } #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 ref global::System.Collections.Generic.List kept = ref __frame.Run__kept; switch (__frame.ResumeKey) { case "wait": goto wait; } #line 42 "TestScripts.cs" kept = Route; #line hidden wait: #line 45 "TestScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 47 "TestScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 50 "TestScripts.cs" Remembered = kept; #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 "wait": __frame.SaveLocal("Run.kept", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class ConvertedScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.UnitTests.Point Run__start; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.start"); } } [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 ConvertedScript() { } protected ConvertedScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Destination", out global::Ariadne.UnitTests.Waypoint loaded)) { this.Destination = loaded; } else if (!reader.HasField("Destination")) { throw new global::System.IO.InvalidDataException("ConvertedScript's save has no field 'Destination', which has no initializer to fall back on. Give it one."); } } } protected ConvertedScript(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("Destination"); lister.Local("Run.start"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 59 "TestScripts.cs" writer.Field("Destination", this.Destination); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.start": #line 63 "TestScripts.cs" writer.Local("Run.start", this.Run__start); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Run.start", out global::Ariadne.UnitTests.Point loaded)) { this.Run__start = loaded; } } } } #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 ref global::Ariadne.UnitTests.Point start = ref __frame.Run__start; switch (__frame.ResumeKey) { case "wait": goto wait; } #line 63 "TestScripts.cs" start = new Point(1.5, -2); #line hidden wait: #line 66 "TestScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 68 "TestScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 71 "TestScripts.cs" Destination = new Waypoint { Name = "back to start", At = start }; #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 "wait": __frame.SaveLocal("Run.start", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class ChainScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { } } [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); } public ChainScript() { } private ChainScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Next", out global::Ariadne.Vellum.UnitTests.ChainScript loaded)) { this.Next = loaded; } else if (!reader.HasField("Next")) { throw new global::System.IO.InvalidDataException("ChainScript's save has no field 'Next', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Depth", out int loaded)) { this.Depth = loaded; } else if (!reader.HasField("Depth")) { throw new global::System.IO.InvalidDataException("ChainScript's save has no field 'Depth', which has no initializer to fall back on. Give it one."); } } } private ChainScript(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("Next"); lister.Field("Depth"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 80 "TestScripts.cs" writer.Field("Next", this.Next); #line 82 "TestScripts.cs" writer.Field("Depth", this.Depth); #line default } #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) { } #line hidden __frame.Exit(); return true; #line default } } } namespace Ariadne.Vellum.UnitTests { partial class MissionScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } protected MissionScript() { } protected MissionScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Stage", out int loaded)) { this.Stage = loaded; } else if (!reader.HasField("Stage")) { throw new global::System.IO.InvalidDataException("MissionScript's save has no field 'Stage', which has no initializer to fall back on. Give it one."); } } } protected MissionScript(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("Stage"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 91 "TestScripts.cs" writer.Field("Stage", this.Stage); #line default } #pragma warning disable } } namespace Ariadne.Vellum.UnitTests { partial class ReliefScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Vellum.UnitTests.MissionScript.__Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { global::Ariadne.Vellum.UnitTests.MissionScript.__Frame.ListParts(lister); } } [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); } public ReliefScript() { } private ReliefScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Crates", out int loaded)) { this.Crates = loaded; } else if (!reader.HasField("Crates")) { throw new global::System.IO.InvalidDataException("ReliefScript's save has no field 'Crates', which has no initializer to fall back on. Give it one."); } } } private ReliefScript(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("Crates"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 96 "TestScripts.cs" writer.Field("Crates", this.Crates); #line default } #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) { } #line hidden __frame.Exit(); return true; #line default } } } namespace Ariadne.Vellum.UnitTests { partial class OwnedScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { } } [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); } public OwnedScript() { } protected OwnedScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Owner", out global::Ariadne.Vellum.UnitTests.Entity loaded)) { this.Owner = loaded; } else if (!reader.HasField("Owner")) { throw new global::System.IO.InvalidDataException("OwnedScript's save has no field 'Owner', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Progress", out int loaded)) { this.Progress = loaded; } else if (!reader.HasField("Progress")) { throw new global::System.IO.InvalidDataException("OwnedScript's save has no field 'Progress', which has no initializer to fall back on. Give it one."); } } } protected OwnedScript(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("Owner"); lister.Field("Progress"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 165 "TestScripts.cs" writer.Field("Owner", this.Owner); #line 167 "TestScripts.cs" writer.Field("Progress", this.Progress); #line default } #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) { } #line hidden __frame.Exit(); return true; #line default } } } namespace Ariadne.Vellum.UnitTests { partial class StepsScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Hold__seen; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Hold.seen"); } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } protected StepsScript() { } protected StepsScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Note", out string loaded)) { this.Note = loaded; } } } protected StepsScript(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("Note"); lister.Local("Hold.seen"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 179 "TestScripts.cs" writer.Field("Note", this.Note); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Hold.seen": #line 183 "TestScripts.cs" writer.Local("Hold.seen", this.Hold__seen); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Hold.seen", out int loaded)) { this.Hold__seen = loaded; } } } } #pragma warning disable [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected bool Hold__Passage(__Frame __frame, global::Ariadne.TickTime __time, Gates gates) { #line hidden ref int seen = ref __frame.Hold__seen; switch (__frame.ResumeKey) { case "wait": goto wait; } #line 183 "TestScripts.cs" seen = 0; #line hidden wait: #line 186 "TestScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 188 "TestScripts.cs" seen++; #line 189 "TestScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 192 "TestScripts.cs" Note = "held " + seen; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected void Hold__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Hold.seen", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class SteppingScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Vellum.UnitTests.StepsScript.__Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { global::Ariadne.Vellum.UnitTests.StepsScript.__Frame.ListParts(lister); } } [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 SteppingScript() { } protected SteppingScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Stage", out int loaded)) { this.Stage = loaded; } else if (!reader.HasField("Stage")) { throw new global::System.IO.InvalidDataException("SteppingScript's save has no field 'Stage', which has no initializer to fall back on. Give it one."); } } } protected SteppingScript(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("Stage"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 201 "TestScripts.cs" writer.Field("Stage", this.Stage); #line default } #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 "first": goto first; } #line 205 "TestScripts.cs" Stage = 1; #line hidden first: #line 208 "TestScripts.cs" using (__frame.Enter("first")) { if (!Hold__Passage(__frame, __time, gates)) { return false; } } #line 209 "TestScripts.cs" Stage = 2; #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 "first": Hold__LocalsToSave(__frame, depth + 1, writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class PlantScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Update__waited; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Update.waited"); } } [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); } public PlantScript() { } protected PlantScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Updates", out int loaded)) { this.Updates = loaded; } else if (!reader.HasField("Updates")) { throw new global::System.IO.InvalidDataException("PlantScript's save has no field 'Updates', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Note", out string loaded)) { this.Note = loaded; } } } protected PlantScript(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("Updates"); lister.Field("Note"); lister.Local("Update.waited"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 218 "TestScripts.cs" writer.Field("Updates", this.Updates); #line 220 "TestScripts.cs" writer.Field("Note", this.Note); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Update.waited": #line 224 "TestScripts.cs" writer.Local("Update.waited", this.Update__waited); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Update.waited", out int loaded)) { this.Update__waited = loaded; } } } } #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) { } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public bool Update__Passage(__Frame __frame, global::Ariadne.TickTime __time, Gates gates) { #line hidden ref int waited = ref __frame.Update__waited; switch (__frame.ResumeKey) { case "wait": goto wait; } #line 224 "TestScripts.cs" waited = 0; #line hidden wait: #line 227 "TestScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 229 "TestScripts.cs" waited++; #line 230 "TestScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 233 "TestScripts.cs" Updates += waited; #line 234 "TestScripts.cs" Note = "updated after " + waited; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public void Update__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "wait": __frame.SaveLocal("Update.waited", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class OperatorScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Run__before; 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.before"); { 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 OperatorScript() { } protected OperatorScript(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("OperatorScript'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("OperatorScript's save has no field 'Result', which has no initializer to fall back on. Give it one."); } } } protected OperatorScript(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.before"); { 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 247 "TestScripts.cs" writer.Field("Plant", this.Plant); #line 249 "TestScripts.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.before": #line 253 "TestScripts.cs" writer.Local("Run.before", this.Run__before); #line hidden return; case "Run.update/receiver": #line 256 "TestScripts.cs" writer.Local("receiver", this.Run____call_update_receiver); #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.before", out int loaded)) { this.Run__before = 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 ref int before = ref __frame.Run__before; switch (__frame.ResumeKey) { case "update": goto update; } #line 253 "TestScripts.cs" before = 7; #line hidden update: #line 256 "TestScripts.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 257 "TestScripts.cs" Result = "done " + before + " " + 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.before", 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; } } } } namespace Ariadne.Vellum.UnitTests { partial class Squad { partial class Scout { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public int Run__waited; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.waited"); } } [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 Scout() { } protected Scout(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Reported", out int loaded)) { this.Reported = loaded; } else if (!reader.HasField("Reported")) { throw new global::System.IO.InvalidDataException("Scout's save has no field 'Reported', which has no initializer to fall back on. Give it one."); } } } protected Scout(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("Reported"); lister.Local("Run.waited"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 268 "TestScripts.cs" writer.Field("Reported", this.Reported); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.waited": #line 272 "TestScripts.cs" writer.Local("Run.waited", this.Run__waited); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Run.waited", out int loaded)) { this.Run__waited = loaded; } } } } #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 ref int waited = ref __frame.Run__waited; switch (__frame.ResumeKey) { case "look": goto look; } #line 272 "TestScripts.cs" waited = 0; #line hidden look: #line 275 "TestScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 277 "TestScripts.cs" waited++; #line 278 "TestScripts.cs" __frame.Mark("look"); return false; #line hidden } #line 281 "TestScripts.cs" Reported = waited; #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 "look": __frame.SaveLocal("Run.waited", writer); break; } } } } } namespace Ariadne.Vellum.UnitTests { partial class Relay { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public T Run__held; public T Deliver__carried; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Deliver.carried"); lister.Local("Run.held"); } } [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 Relay() { } protected Relay(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Source", out T loaded)) { this.Source = loaded; } else if (!reader.HasField("Source")) { throw new global::System.IO.InvalidDataException("Relay's save has no field 'Source', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Delivered", out T loaded)) { this.Delivered = loaded; } else if (!reader.HasField("Delivered")) { throw new global::System.IO.InvalidDataException("Relay's save has no field 'Delivered', which has no initializer to fall back on. Give it one."); } } } protected Relay(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("Source"); lister.Field("Delivered"); lister.Local("Deliver.carried"); lister.Local("Run.held"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 291 "TestScripts.cs" writer.Field("Source", this.Source); #line 293 "TestScripts.cs" writer.Field("Delivered", this.Delivered); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Deliver.carried": #line 297 "TestScripts.cs" writer.Local("Deliver.carried", this.Deliver__carried); #line hidden return; case "Run.held": #line 310 "TestScripts.cs" writer.Local("Run.held", this.Run__held); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Deliver.carried", out T loaded)) { this.Deliver__carried = loaded; } } { if (reader.TryLocal("Run.held", out T loaded)) { this.Run__held = loaded; } } } } #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 ref T held = ref __frame.Run__held; switch (__frame.ResumeKey) { case "wait": goto wait; } #line 310 "TestScripts.cs" held = Source; #line hidden wait: #line 313 "TestScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 315 "TestScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 318 "TestScripts.cs" Delivered = held; #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 "wait": __frame.SaveLocal("Run.held", writer); break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public bool Deliver__Passage(__Frame __frame, global::Ariadne.TickTime __time, Gates gates, T item) { #line hidden ref T carried = ref __frame.Deliver__carried; switch (__frame.ResumeKey) { case "carry": goto carry; } #line 297 "TestScripts.cs" carried = item; #line hidden carry: #line 300 "TestScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 302 "TestScripts.cs" __frame.Mark("carry"); return false; #line hidden } #line 305 "TestScripts.cs" Delivered = carried; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public void Deliver__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "carry": __frame.SaveLocal("Deliver.carried", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class RelayTender { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public string Run__mail; public global::Ariadne.Vellum.UnitTests.Relay Run____call_deliver_receiver; public global::Ariadne.Vellum.UnitTests.Relay.__Frame Run____call_deliver_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.mail"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.deliver/", typeof(global::Ariadne.Vellum.UnitTests.Relay.__Frame)); if (scope != null) { scope.Local>("receiver"); global::Ariadne.Vellum.UnitTests.Relay.__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 RelayTender() { } protected RelayTender(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField>("Relay", out global::Ariadne.Vellum.UnitTests.Relay loaded)) { this.Relay = loaded; } else if (!reader.HasField("Relay")) { throw new global::System.IO.InvalidDataException("RelayTender's save has no field 'Relay', which has no initializer to fall back on. Give it one."); } } } protected RelayTender(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>("Relay"); lister.Local("Run.mail"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.deliver/", typeof(global::Ariadne.Vellum.UnitTests.Relay.__Frame)); if (scope != null) { scope.Local>("receiver"); global::Ariadne.Vellum.UnitTests.Relay.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 327 "TestScripts.cs" writer.Field>("Relay", this.Relay); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.deliver/receiver": #line 334 "TestScripts.cs" writer.Local>("receiver", this.Run____call_deliver_receiver); #line hidden return; case "Run.mail": #line 331 "TestScripts.cs" writer.Local("Run.mail", this.Run__mail); #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.mail", out string loaded)) { this.Run__mail = loaded; } } { if (reader.TryScope("Run.deliver/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal>("receiver", out global::Ariadne.Vellum.UnitTests.Relay loaded)) { this.Run____call_deliver_receiver = loaded; } } if (this.Run____call_deliver_receiver != null) { this.Run____call_deliver_frame = (global::Ariadne.Vellum.UnitTests.Relay.__Frame)this.Run____call_deliver_receiver.NewFrame(); this.Run____call_deliver_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_deliver_frame != null) { this.Run____call_deliver_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_deliver_frame != null) { this.Run____call_deliver_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 ref string mail = ref __frame.Run__mail; switch (__frame.ResumeKey) { case "deliver": goto deliver; } #line 331 "TestScripts.cs" mail = "mail"; #line hidden deliver: #line 334 "TestScripts.cs" using (__frame.Enter("deliver")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_deliver_receiver = (Relay); __frame.Run____call_deliver_frame = null; } if (__frame.Run____call_deliver_frame == null) { __frame.Run____call_deliver_frame = (global::Ariadne.Vellum.UnitTests.Relay.__Frame)__frame.Run____call_deliver_receiver.NewFrame(); } if (!__frame.Run____call_deliver_receiver.Deliver__Passage(__frame.Lend(__frame.Run____call_deliver_frame), __time, gates, __frame.ResumeKey == null ? (mail) : default(string))) { return false; } } #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 "deliver": __frame.SaveLocal("Run.mail", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.deliver/"); __frame.SaveLocal("Run.deliver/receiver", scope); if (__frame.Run____call_deliver_receiver != null) { __frame.Run____call_deliver_receiver.Deliver__LocalsToSave(__frame.Lend(__frame.Run____call_deliver_frame), depth + 1, scope); } } break; } } } } namespace Ariadne.Vellum.UnitTests { partial class PassageHolder { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame Run____call_first_frame; public global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame Run____call_second_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.first/", typeof(global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame)); if (scope != null) { global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame.ListParts(scope); } } { global::Ariadne.IArcPartLister scope = lister.Scope("Run.second/", typeof(global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame)); if (scope != null) { global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Hold__Frame : global::Ariadne.Frame { public string Hold__gate; public X Hold__held; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Hold.gate"); lister.Local("Hold.held"); } } [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 PassageHolder() { } protected PassageHolder(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Report", out string loaded)) { this.Report = loaded; } } } protected PassageHolder(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("Report"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.first/", typeof(global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame)); if (scope != null) { global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame.ListParts(scope); } } { global::Ariadne.IArcPartLister scope = lister.Scope("Run.second/", typeof(global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame)); if (scope != null) { global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 343 "TestScripts.cs" writer.Field("Report", this.Report); #line default } #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.TryScope("Run.first/", out global::Ariadne.IArcReader scope)) { this.Run____call_first_frame = new global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame(); this.Run____call_first_frame.LoadLocals(scope); } } { if (reader.TryScope("Run.second/", out global::Ariadne.IArcReader scope)) { this.Run____call_second_frame = new global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame(); this.Run____call_second_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_first_frame != null) { this.Run____call_first_frame.AttachWaits(slot); } if (this.Run____call_second_frame != null) { this.Run____call_second_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_first_frame != null) { this.Run____call_first_frame.EndWaits(); } if (this.Run____call_second_frame != null) { this.Run____call_second_frame.EndWaits(); } } } #pragma warning restore public partial class Hold__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Hold.gate": #line 345 "TestScripts.cs" writer.Local("Hold.gate", this.Hold__gate); #line hidden return; case "Hold.held": #line 347 "TestScripts.cs" writer.Local("Hold.held", this.Hold__held); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Hold__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Hold.gate", out string loaded)) { this.Hold__gate = loaded; } } { if (reader.TryLocal("Hold.held", out X loaded)) { this.Hold__held = loaded; } } } } #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 "first": goto first; case "second": goto second; } #line hidden first: #line 361 "TestScripts.cs" using (__frame.Enter("first")) { if (__frame.Run____call_first_frame == null) { __frame.Run____call_first_frame = new global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame(); } if (!Hold__Passage(__frame.Lend(__frame.Run____call_first_frame), __frame, __time, gates, __frame.ResumeKey == null ? (5) : default(int), __frame.ResumeKey == null ? ("go1") : default(string))) { return false; } } #line hidden second: #line 364 "TestScripts.cs" using (__frame.Enter("second")) { if (__frame.Run____call_second_frame == null) { __frame.Run____call_second_frame = new global::Ariadne.Vellum.UnitTests.PassageHolder.Hold__Frame(); } if (!Hold__Passage(__frame.Lend(__frame.Run____call_second_frame), __frame, __time, gates, __frame.ResumeKey == null ? ("five") : default(string), __frame.ResumeKey == null ? ("go2") : default(string))) { return false; } } #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 "first": { global::Ariadne.IArcWriter scope = writer.Scope("Run.first/"); Hold__LocalsToSave(__frame.Lend(__frame.Run____call_first_frame), __frame, depth + 1, scope, writer); } break; case "second": { global::Ariadne.IArcWriter scope = writer.Scope("Run.second/"); Hold__LocalsToSave(__frame.Lend(__frame.Run____call_second_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Hold__Passage(Hold__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, Gates gates, X item, string gate__argument) { #line hidden ref string gate = ref __frame.Hold__gate; if (__frame.ResumeKey == null) { gate = gate__argument; } ref X held = ref __frame.Hold__held; switch (__frame.ResumeKey) { case "hold": goto hold; } #line 347 "TestScripts.cs" held = item; #line hidden hold: #line 350 "TestScripts.cs" while (!gates.Open.Contains(gate)) #line hidden { #line 352 "TestScripts.cs" __frame.Mark("hold"); return false; #line hidden } #line 355 "TestScripts.cs" Report += held + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Hold__LocalsToSave(Hold__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "hold": __frame.SaveLocal("Hold.gate", writer); __frame.SaveLocal("Hold.held", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class NestedRelay { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.Vellum.UnitTests.NestedRelay.Outer__Frame Run____call_start_frame; public string Step__gate; public int Step__spins; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Step.gate"); lister.Local("Step.spins"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.Vellum.UnitTests.NestedRelay.Outer__Frame)); if (scope != null) { global::Ariadne.Vellum.UnitTests.NestedRelay.Outer__Frame.ListParts(scope); } } } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Inner__Frame : global::Ariadne.Frame { public string Inner__gate; public Y Inner__deep; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Inner.deep"); lister.Local("Inner.gate"); } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Outer__Frame : global::Ariadne.Frame { public X Outer__held; public global::Ariadne.Vellum.UnitTests.NestedRelay.Inner__Frame Outer____call_second_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Outer.held"); { global::Ariadne.IArcPartLister scope = lister.Scope("Outer.second/", typeof(global::Ariadne.Vellum.UnitTests.NestedRelay.Inner__Frame)); if (scope != null) { global::Ariadne.Vellum.UnitTests.NestedRelay.Inner__Frame.ListParts(scope); } } } } [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 NestedRelay() { } protected NestedRelay(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Report", out string loaded)) { this.Report = loaded; } } } protected NestedRelay(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("Report"); lister.Local("Step.gate"); lister.Local("Step.spins"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.start/", typeof(global::Ariadne.Vellum.UnitTests.NestedRelay.Outer__Frame)); if (scope != null) { global::Ariadne.Vellum.UnitTests.NestedRelay.Outer__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 374 "TestScripts.cs" writer.Field("Report", this.Report); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Step.gate": #line 376 "TestScripts.cs" writer.Local("Step.gate", this.Step__gate); #line hidden return; case "Step.spins": #line 378 "TestScripts.cs" writer.Local("Step.spins", this.Step__spins); #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("Step.gate", out string loaded)) { this.Step__gate = loaded; } } { if (reader.TryLocal("Step.spins", out int loaded)) { this.Step__spins = loaded; } } { if (reader.TryScope("Run.start/", out global::Ariadne.IArcReader scope)) { this.Run____call_start_frame = new global::Ariadne.Vellum.UnitTests.NestedRelay.Outer__Frame(); this.Run____call_start_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_start_frame != null) { this.Run____call_start_frame.EndWaits(); } } } #pragma warning restore public partial class Inner__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Inner.deep": #line 392 "TestScripts.cs" writer.Local("Inner.deep", this.Inner__deep); #line hidden return; case "Inner.gate": #line 390 "TestScripts.cs" writer.Local("Inner.gate", this.Inner__gate); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Inner__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Inner.deep", out Y loaded)) { this.Inner__deep = loaded; } } { if (reader.TryLocal("Inner.gate", out string loaded)) { this.Inner__gate = loaded; } } } } #pragma warning restore public partial class Outer__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Outer.held": #line 405 "TestScripts.cs" writer.Local("Outer.held", this.Outer__held); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Outer__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.LoadLocals(reader); { if (reader.TryLocal("Outer.held", out X loaded)) { this.Outer__held = loaded; } } { if (reader.TryScope("Outer.second/", out global::Ariadne.IArcReader scope)) { this.Outer____call_second_frame = new global::Ariadne.Vellum.UnitTests.NestedRelay.Inner__Frame(); this.Outer____call_second_frame.LoadLocals(scope); } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Outer____call_second_frame != null) { this.Outer____call_second_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Outer____call_second_frame != null) { this.Outer____call_second_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 "start": goto start; } #line hidden start: #line 417 "TestScripts.cs" using (__frame.Enter("start")) { if (__frame.Run____call_start_frame == null) { __frame.Run____call_start_frame = new global::Ariadne.Vellum.UnitTests.NestedRelay.Outer__Frame(); } if (!Outer__Passage(__frame.Lend(__frame.Run____call_start_frame), __frame, __time, gates, __frame.ResumeKey == null ? (9) : default(int))) { return false; } } #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 "start": { global::Ariadne.IArcWriter scope = writer.Scope("Run.start/"); Outer__LocalsToSave(__frame.Lend(__frame.Run____call_start_frame), __frame, depth + 1, scope, writer); } break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Step__Passage(__Frame __frame, global::Ariadne.TickTime __time, Gates gates, string gate__argument) { #line hidden ref string gate = ref __frame.Step__gate; if (__frame.ResumeKey == null) { gate = gate__argument; } ref int spins = ref __frame.Step__spins; switch (__frame.ResumeKey) { case "step": goto step; } #line 378 "TestScripts.cs" spins = 0; #line hidden step: #line 381 "TestScripts.cs" while (!gates.Open.Contains(gate)) #line hidden { #line 383 "TestScripts.cs" ++spins; #line 384 "TestScripts.cs" __frame.Mark("step"); return false; #line hidden } #line 387 "TestScripts.cs" Report += "step" + spins + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Step__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "step": __frame.SaveLocal("Step.gate", writer); __frame.SaveLocal("Step.spins", writer); break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Inner__Passage(Inner__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, Gates gates, Y item, string gate__argument) { #line hidden ref string gate = ref __frame.Inner__gate; if (__frame.ResumeKey == null) { gate = gate__argument; } ref Y deep = ref __frame.Inner__deep; switch (__frame.ResumeKey) { case "inner": goto inner; } #line 392 "TestScripts.cs" deep = item; #line hidden inner: #line 395 "TestScripts.cs" while (!gates.Open.Contains(gate)) #line hidden { #line 397 "TestScripts.cs" __frame.Mark("inner"); return false; #line hidden } #line 400 "TestScripts.cs" Report += "inner" + deep + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Inner__LocalsToSave(Inner__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "inner": __frame.SaveLocal("Inner.gate", writer); __frame.SaveLocal("Inner.deep", writer); break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Outer__Passage(Outer__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, Gates gates, X item) { #line hidden ref X held = ref __frame.Outer__held; switch (__frame.ResumeKey) { case "first": goto first; case "second": goto second; } #line 405 "TestScripts.cs" held = item; #line hidden first: #line 408 "TestScripts.cs" using (__frame.Enter("first")) { int __depth = __arcFrame.Depth; bool __done = Step__Passage(__frame.Lend(__arcFrame), __time, gates, __frame.ResumeKey == null ? ("a") : default(string)); __arcFrame.Depth = __depth; if (!__done) { return false; } } #line hidden second: #line 411 "TestScripts.cs" using (__frame.Enter("second")) { if (__frame.Outer____call_second_frame == null) { __frame.Outer____call_second_frame = new global::Ariadne.Vellum.UnitTests.NestedRelay.Inner__Frame(); } if (!Inner__Passage(__frame.Lend(__frame.Outer____call_second_frame), __arcFrame, __time, gates, __frame.ResumeKey == null ? (held) : default(X), __frame.ResumeKey == null ? ("b") : default(string))) { return false; } } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Outer__LocalsToSave(Outer__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "first": __frame.SaveLocal("Outer.held", writer); Step__LocalsToSave(__arcFrame, depth + 1, arcWriter); break; case "second": __frame.SaveLocal("Outer.held", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Outer.second/"); Inner__LocalsToSave(__frame.Lend(__frame.Outer____call_second_frame), __arcFrame, depth + 1, scope, arcWriter); } break; } } } } namespace Ariadne.Vellum.UnitTests { partial class Greenhouse { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public string Step__gate; public int Step__spins; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Step.gate"); lister.Local("Step.spins"); } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] protected override global::Ariadne.Frame __CreateFrame() { return new __Frame(); } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class Grow__Frame : global::Ariadne.Frame { public string Grow__gate; public X Grow__kept; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Grow.gate"); lister.Local("Grow.kept"); } } [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); } public Greenhouse() { } protected Greenhouse(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Note", out string loaded)) { this.Note = loaded; } } } protected Greenhouse(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("Note"); lister.Local("Step.gate"); lister.Local("Step.spins"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 426 "TestScripts.cs" writer.Field("Note", this.Note); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Step.gate": #line 428 "TestScripts.cs" writer.Local("Step.gate", this.Step__gate); #line hidden return; case "Step.spins": #line 430 "TestScripts.cs" writer.Local("Step.spins", this.Step__spins); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class __Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Step.gate", out string loaded)) { this.Step__gate = loaded; } } { if (reader.TryLocal("Step.spins", out int loaded)) { this.Step__spins = loaded; } } } } #pragma warning restore public partial class Grow__Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Grow.gate": #line 442 "TestScripts.cs" writer.Local("Grow.gate", this.Grow__gate); #line hidden return; case "Grow.kept": #line 444 "TestScripts.cs" writer.Local("Grow.kept", this.Grow__kept); #line hidden return; } #line default base.SaveLocal(key, writer); } } #pragma warning disable public partial class Grow__Frame { public override void LoadLocals(global::Ariadne.IArcReader reader) { base.LoadLocals(reader); { if (reader.TryLocal("Grow.gate", out string loaded)) { this.Grow__gate = loaded; } } { if (reader.TryLocal("Grow.kept", out X loaded)) { this.Grow__kept = loaded; } } } } #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) { } #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private bool Step__Passage(__Frame __frame, global::Ariadne.TickTime __time, Gates gates, string gate__argument) { #line hidden ref string gate = ref __frame.Step__gate; if (__frame.ResumeKey == null) { gate = gate__argument; } ref int spins = ref __frame.Step__spins; switch (__frame.ResumeKey) { case "step": goto step; } #line 430 "TestScripts.cs" spins = 0; #line hidden step: #line 433 "TestScripts.cs" while (!gates.Open.Contains(gate)) #line hidden { #line 435 "TestScripts.cs" ++spins; #line 436 "TestScripts.cs" __frame.Mark("step"); return false; #line hidden } #line 439 "TestScripts.cs" Note += "step" + spins + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] private void Step__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "step": __frame.SaveLocal("Step.gate", writer); __frame.SaveLocal("Step.spins", writer); break; } } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public bool Grow__Passage(Grow__Frame __frame, __Frame __arcFrame, global::Ariadne.TickTime __time, Gates gates, X seed, string gate__argument) { #line hidden ref string gate = ref __frame.Grow__gate; if (__frame.ResumeKey == null) { gate = gate__argument; } ref X kept = ref __frame.Grow__kept; switch (__frame.ResumeKey) { case "grow": goto grow; case "wait": goto wait; } #line 444 "TestScripts.cs" kept = seed; #line hidden grow: #line 447 "TestScripts.cs" using (__frame.Enter("grow")) { int __depth = __arcFrame.Depth; bool __done = Step__Passage(__frame.Lend(__arcFrame), __time, gates, __frame.ResumeKey == null ? ("s") : default(string)); __arcFrame.Depth = __depth; if (!__done) { return false; } } #line hidden wait: #line 450 "TestScripts.cs" while (!gates.Open.Contains(gate)) #line hidden { #line 452 "TestScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 455 "TestScripts.cs" Note += "grew" + kept + ";"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public void Grow__LocalsToSave(Grow__Frame __frame, __Frame __arcFrame, int depth, global::Ariadne.IArcWriter writer, global::Ariadne.IArcWriter arcWriter) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "grow": __frame.SaveLocal("Grow.gate", writer); __frame.SaveLocal("Grow.kept", writer); Step__LocalsToSave(__arcFrame, depth + 1, arcWriter); break; case "wait": __frame.SaveLocal("Grow.gate", writer); __frame.SaveLocal("Grow.kept", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class Farmer { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.Vellum.UnitTests.Greenhouse Run____call_first_receiver; public global::Ariadne.Vellum.UnitTests.Greenhouse.__Frame Run____call_first_frame; public global::Ariadne.Vellum.UnitTests.Greenhouse.Grow__Frame Run____call_first_ownedFrame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.first/", typeof(global::Ariadne.Vellum.UnitTests.Greenhouse.__Frame), typeof(global::Ariadne.Vellum.UnitTests.Greenhouse.Grow__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.Vellum.UnitTests.Greenhouse.__Frame.ListParts(scope); global::Ariadne.Vellum.UnitTests.Greenhouse.Grow__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 Farmer() { } protected Farmer(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("House", out global::Ariadne.Vellum.UnitTests.Greenhouse loaded)) { this.House = loaded; } else if (!reader.HasField("House")) { throw new global::System.IO.InvalidDataException("Farmer's save has no field 'House', which has no initializer to fall back on. Give it one."); } } } protected Farmer(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("House"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.first/", typeof(global::Ariadne.Vellum.UnitTests.Greenhouse.__Frame), typeof(global::Ariadne.Vellum.UnitTests.Greenhouse.Grow__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.Vellum.UnitTests.Greenhouse.__Frame.ListParts(scope); global::Ariadne.Vellum.UnitTests.Greenhouse.Grow__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 468 "TestScripts.cs" writer.Field("House", this.House); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.first/receiver": #line 473 "TestScripts.cs" writer.Local("receiver", this.Run____call_first_receiver); #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.TryScope("Run.first/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.Vellum.UnitTests.Greenhouse loaded)) { this.Run____call_first_receiver = loaded; } } if (this.Run____call_first_receiver != null) { this.Run____call_first_frame = (global::Ariadne.Vellum.UnitTests.Greenhouse.__Frame)this.Run____call_first_receiver.NewFrame(); this.Run____call_first_frame.LoadLocals(scope); this.Run____call_first_ownedFrame = new global::Ariadne.Vellum.UnitTests.Greenhouse.Grow__Frame(); this.Run____call_first_ownedFrame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_first_frame != null) { this.Run____call_first_frame.AttachWaits(slot); } if (this.Run____call_first_ownedFrame != null) { this.Run____call_first_ownedFrame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_first_frame != null) { this.Run____call_first_frame.EndWaits(); } if (this.Run____call_first_ownedFrame != null) { this.Run____call_first_ownedFrame.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 "first": goto first; } #line hidden first: #line 473 "TestScripts.cs" using (__frame.Enter("first")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_first_receiver = (House); __frame.Run____call_first_frame = null; __frame.Run____call_first_ownedFrame = null; } if (__frame.Run____call_first_frame == null) { __frame.Run____call_first_frame = (global::Ariadne.Vellum.UnitTests.Greenhouse.__Frame)__frame.Run____call_first_receiver.NewFrame(); } if (__frame.Run____call_first_ownedFrame == null) { __frame.Run____call_first_ownedFrame = new global::Ariadne.Vellum.UnitTests.Greenhouse.Grow__Frame(); } if (!__frame.Run____call_first_receiver.Grow__Passage(__frame.Lend(__frame.Run____call_first_ownedFrame), __frame.Lend(__frame.Run____call_first_frame), __time, gates, __frame.ResumeKey == null ? (4) : default(int), __frame.ResumeKey == null ? ("g1") : default(string))) { return false; } } #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 "first": { global::Ariadne.IArcWriter scope = writer.Scope("Run.first/"); __frame.SaveLocal("Run.first/receiver", scope); if (__frame.Run____call_first_receiver != null) { __frame.Run____call_first_receiver.Grow__LocalsToSave(__frame.Lend(__frame.Run____call_first_ownedFrame), __frame.Lend(__frame.Run____call_first_frame), depth + 1, scope, scope); } } break; } } } } namespace Ariadne.Vellum.UnitTests { partial class CounterScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { } } [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); } public CounterScript() { } protected CounterScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Counted", out int loaded)) { this.Counted = loaded; } else if (!reader.HasField("Counted")) { throw new global::System.IO.InvalidDataException("CounterScript's save has no field 'Counted', which has no initializer to fall back on. Give it one."); } } } protected CounterScript(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("Counted"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 482 "TestScripts.cs" writer.Field("Counted", this.Counted); #line default } #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 "count": goto count; } #line hidden count: #line 487 "TestScripts.cs" while (!gates.Open.Contains("stop")) #line hidden { #line 489 "TestScripts.cs" Counted++; #line 490 "TestScripts.cs" __frame.Mark("count"); return false; #line hidden } #line hidden __frame.Exit(); return true; #line default } } } namespace Ariadne.Vellum.UnitTests { partial class SupervisorScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public static void ListParts(global::Ariadne.IArcPartLister lister) { } } [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); } public SupervisorScript() { } protected SupervisorScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Child", out global::Ariadne.Vellum.UnitTests.CounterScript loaded)) { this.Child = loaded; } } { if (reader.TryField("Result", out string loaded)) { this.Result = loaded; } } } protected SupervisorScript(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("Child"); lister.Field("Result"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 500 "TestScripts.cs" writer.Field("Child", this.Child); #line 502 "TestScripts.cs" writer.Field("Result", this.Result); #line default } #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 "wait": goto wait; } #line hidden wait: #line 513 "TestScripts.cs" while (!Child.Finished) #line hidden { #line 515 "TestScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line 518 "TestScripts.cs" Result = "child counted " + Child.Counted; #line hidden __frame.Exit(); return true; #line default } } }