// // 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 Amphora; namespace Ariadne.Vellum.UnitTests { partial class RollingScript { [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); } protected RollingScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Rand", out global::Amphora.Rand loaded)) { this.Rand = loaded; } else if (!reader.HasField("Rand")) { throw new global::System.IO.InvalidDataException("RollingScript's save has no field 'Rand', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField>("Rolls", out global::System.Collections.Generic.List loaded)) { this.Rolls = loaded; } } } protected RollingScript(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("Rand"); lister.Field>("Rolls"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 11 "RollingScripts.cs" writer.Field("Rand", this.Rand); #line 13 "RollingScripts.cs" writer.Field>("Rolls", this.Rolls); #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 23 "RollingScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 25 "RollingScripts.cs" Rolls.Add(Rand.NextInt(1, 7)); #line 26 "RollingScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line hidden __frame.Exit(); return true; #line default } } } namespace Ariadne.Vellum.UnitTests { partial class EventWaitScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Amphora.Duration Run____wait1; public static void ListParts(global::Ariadne.IArcPartLister lister) { lister.Local("Run.__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); } protected override void __SaveLocals(global::Ariadne.IArcWriter writer) { Run__LocalsToSave((__Frame)__CurrentFrame, 0, writer); } protected EventWaitScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Rand", out global::Amphora.Rand loaded)) { this.Rand = loaded; } else if (!reader.HasField("Rand")) { throw new global::System.IO.InvalidDataException("EventWaitScript's save has no field 'Rand', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Woke", out bool loaded)) { this.Woke = loaded; } else if (!reader.HasField("Woke")) { throw new global::System.IO.InvalidDataException("EventWaitScript's save has no field 'Woke', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Mean", out global::Amphora.Duration loaded)) { this.Mean = loaded; } } } protected EventWaitScript(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("Rand"); lister.Field("Woke"); lister.Field("Mean"); lister.Local("Run.__wait1"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 37 "RollingScripts.cs" writer.Field("Rand", this.Rand); #line 39 "RollingScripts.cs" writer.Field("Woke", this.Woke); #line 41 "RollingScripts.cs" writer.Field("Mean", this.Mean); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.__wait1": #line 51 "RollingScripts.cs" writer.Local("Run.__wait1", this.Run____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("Run.__wait1", out global::Amphora.Duration loaded)) { this.Run____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) { case "wait": goto wait__resume; } #line hidden wait: #line 51 "RollingScripts.cs" __frame.Run____wait1 = __time.DeadlineAfter(Rand.NextEvent(Mean)); #line hidden wait__resume: #line 51 "RollingScripts.cs" if (__time.GameTime < __frame.Run____wait1) { __frame.Sleep(__frame.Run____wait1); __frame.Mark("wait"); return false; } #line 52 "RollingScripts.cs" Woke = true; #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.__wait1", writer); break; } } } } namespace Ariadne.Vellum.UnitTests { partial class RollerScript { [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); } protected RollerScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Rand", out global::Amphora.Rand loaded)) { this.Rand = loaded; } else if (!reader.HasField("Rand")) { throw new global::System.IO.InvalidDataException("RollerScript's save has no field 'Rand', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField>("Rolls", out global::System.Collections.Generic.List loaded)) { this.Rolls = loaded; } } } protected RollerScript(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("Rand"); lister.Field>("Rolls"); } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 61 "RollingScripts.cs" writer.Field("Rand", this.Rand); #line 63 "RollingScripts.cs" writer.Field>("Rolls", this.Rolls); #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 } [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public bool Roll__Passage(__Frame __frame, global::Ariadne.TickTime __time, Gates gates) { #line hidden switch (__frame.ResumeKey) { case "wait": goto wait; } #line hidden wait: #line 73 "RollingScripts.cs" while (!gates.Open.Contains("go")) #line hidden { #line 75 "RollingScripts.cs" Rolls.Add(Rand.NextInt(1, 7)); #line 76 "RollingScripts.cs" __frame.Mark("wait"); return false; #line hidden } #line hidden __frame.Exit(); return true; #line default } } } namespace Ariadne.Vellum.UnitTests { partial class CallingRollerScript { [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] public partial class __Frame : global::Ariadne.Frame { public global::Ariadne.Vellum.UnitTests.RollerScript Run____call_roll_receiver; public global::Ariadne.Vellum.UnitTests.RollerScript.__Frame Run____call_roll_frame; public static void ListParts(global::Ariadne.IArcPartLister lister) { { global::Ariadne.IArcPartLister scope = lister.Scope("Run.roll/", typeof(global::Ariadne.Vellum.UnitTests.RollerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.Vellum.UnitTests.RollerScript.__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); } protected CallingRollerScript(global::Ariadne.IArcReader reader, global::Ariadne.AutoLoadEveryField load) : base(reader) { { if (reader.TryField("Rand", out global::Amphora.Rand loaded)) { this.Rand = loaded; } else if (!reader.HasField("Rand")) { throw new global::System.IO.InvalidDataException("CallingRollerScript's save has no field 'Rand', which has no initializer to fall back on. Give it one."); } } { if (reader.TryField("Roller", out global::Ariadne.Vellum.UnitTests.RollerScript loaded)) { this.Roller = loaded; } else if (!reader.HasField("Roller")) { throw new global::System.IO.InvalidDataException("CallingRollerScript's save has no field 'Roller', which has no initializer to fall back on. Give it one."); } } } protected CallingRollerScript(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("Rand"); lister.Field("Roller"); { global::Ariadne.IArcPartLister scope = lister.Scope("Run.roll/", typeof(global::Ariadne.Vellum.UnitTests.RollerScript.__Frame)); if (scope != null) { scope.Local("receiver"); global::Ariadne.Vellum.UnitTests.RollerScript.__Frame.ListParts(scope); } } } #pragma warning restore protected override void __SaveFields(global::Ariadne.IArcWriter writer) { base.__SaveFields(writer); #line 90 "RollingScripts.cs" writer.Field("Rand", this.Rand); #line 92 "RollingScripts.cs" writer.Field("Roller", this.Roller); #line default } public partial class __Frame { public override void SaveLocal(string key, global::Ariadne.IArcWriter writer) { switch (key) { case "Run.roll/receiver": #line 103 "RollingScripts.cs" writer.Local("receiver", this.Run____call_roll_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.roll/", out global::Ariadne.IArcReader scope)) { { if (scope.TryLocal("receiver", out global::Ariadne.Vellum.UnitTests.RollerScript loaded)) { this.Run____call_roll_receiver = loaded; } } if (this.Run____call_roll_receiver != null) { this.Run____call_roll_frame = (global::Ariadne.Vellum.UnitTests.RollerScript.__Frame)this.Run____call_roll_receiver.NewFrame(); this.Run____call_roll_frame.LoadLocals(scope); } } } } public override void AttachWaits(global::Ariadne.WakeSlot slot) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.AttachWaits(slot); if (this.Run____call_roll_frame != null) { this.Run____call_roll_frame.AttachWaits(slot); } } public override void EndWaits() { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); base.EndWaits(); if (this.Run____call_roll_frame != null) { this.Run____call_roll_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 "roll": goto roll; } #line hidden roll: #line 103 "RollingScripts.cs" using (__frame.Enter("roll")) { global::System.Runtime.CompilerServices.RuntimeHelpers.EnsureSufficientExecutionStack(); if (__frame.ResumeKey == null) { __frame.Run____call_roll_receiver = (Roller); __frame.Run____call_roll_frame = null; } if (__frame.Run____call_roll_frame == null) { __frame.Run____call_roll_frame = (global::Ariadne.Vellum.UnitTests.RollerScript.__Frame)__frame.Run____call_roll_receiver.NewFrame(); } if (!__frame.Run____call_roll_receiver.Roll__Passage(__frame.Lend(__frame.Run____call_roll_frame), __time, gates)) { 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 "roll": { global::Ariadne.IArcWriter scope = writer.Scope("Run.roll/"); __frame.SaveLocal("Run.roll/receiver", scope); } break; } } } }