// // 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; namespace Ariadne.Vellum.UnitTests { partial class WaitPlantScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Amphora.Duration Pace____wait1; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Pace.__wait1"); } } [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 WaitPlantScript() { } protected WaitPlantScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Note", out string loaded)) { this.Note = loaded; } } } protected WaitPlantScript(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("Pace.__wait1"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 10 "WaitScripts.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 "Pace.__wait1": #line 15 "WaitScripts.cs" writer.Local("Pace.__wait1", this.Pace____wait1); #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("Pace.__wait1", out global::Amphora.Duration loaded)) { this.Pace____wait1 = 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 Pace__Passage(__Frame __frame, global::Ariadne.TickTime __time, Gates gates) { #line hidden switch (__frame.ResumeKey) { case "rest": goto rest__resume; } #line hidden rest: #line 15 "WaitScripts.cs" __frame.Pace____wait1 = __time.DeadlineAfter(TimeSpan.FromSeconds(1)); #line hidden rest__resume: #line 15 "WaitScripts.cs" if (__time.GameTime < __frame.Pace____wait1) { __frame.Sleep(__frame.Pace____wait1); __frame.Mark("rest"); return false; } #line 16 "WaitScripts.cs" Note = "rested"; #line hidden __frame.Exit(); return true; #line default } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public void Pace__LocalsToSave(__Frame __frame, int depth, global::Ariadne.IArcWriter writer) { if (depth >= __frame.Cursor.Count) { return; } switch (__frame.Cursor[depth]) { case "rest": __frame.SaveLocal("Pace.__wait1", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class WaitOperatorScript { [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.WaitPlantScript Run____call_pace_receiver; public global::Ariadne.Vellum.UnitTests.WaitPlantScript.__Frame Run____call_pace_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.before"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.pace/", typeof(global::Ariadne.Vellum.UnitTests.WaitPlantScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.Vellum.UnitTests.WaitPlantScript.__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 WaitOperatorScript() { } protected WaitOperatorScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Plant", out global::Ariadne.Vellum.UnitTests.WaitPlantScript loaded)) { this.Plant = loaded; } else if (!reader.HasField("Plant")) { throw new global::System.IO.InvalidDataException("WaitOperatorScript'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("WaitOperatorScript's save has no field 'Result', which has no initializer to fall back on. Give it one."); } } } protected WaitOperatorScript(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.pace/", typeof(global::Ariadne.Vellum.UnitTests.WaitPlantScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.Vellum.UnitTests.WaitPlantScript.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 29 "WaitScripts.cs" writer.Field("Plant", this.Plant); #line 31 "WaitScripts.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 35 "WaitScripts.cs" writer.Local("Run.before", this.Run__before); #line hidden return; case "Run.pace/receiver": #line 38 "WaitScripts.cs" writer.Local("receiver", this.Run____call_pace_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.pace/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.Vellum.UnitTests.WaitPlantScript loaded)) { this.Run____call_pace_receiver = loaded; } } if (this.Run____call_pace_receiver != null) { this.Run____call_pace_frame = (global::Ariadne.Vellum.UnitTests.WaitPlantScript.__Frame)this.Run____call_pace_receiver.NewFrame(); this.Run____call_pace_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_pace_frame != null) { this.Run____call_pace_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_pace_frame != null) { this.Run____call_pace_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 "pace": goto pace; } #line 35 "WaitScripts.cs" before = 7; #line hidden pace: #line 38 "WaitScripts.cs" using (__frame.Enter("pace")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_pace_receiver = (Plant); __frame.Run____call_pace_frame = null; } if (__frame.Run____call_pace_frame == null) { __frame.Run____call_pace_frame = (global::Ariadne.Vellum.UnitTests.WaitPlantScript.__Frame)__frame.Run____call_pace_receiver.NewFrame(); } if (!__frame.Run____call_pace_receiver.Pace__Passage(__frame.Lend(__frame.Run____call_pace_frame), __time, gates)) { return false; } } #line 39 "WaitScripts.cs" Result = "done " + before; #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 "pace": __frame.SaveLocal("Run.before", writer); { global::Ariadne.IArcWriter scope = writer.Scope("Run.pace/"); __frame.SaveLocal("Run.pace/receiver", scope); if (__frame.Run____call_pace_receiver != null) { __frame.Run____call_pace_receiver.Pace__LocalsToSave(__frame.Lend(__frame.Run____call_pace_frame), depth + 1, scope); } } break; } } } }