From 700ecb78ff7acc245676e10bf9b5beac20f67d44 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sun, 11 Aug 2024 13:59:22 -0400 Subject: [PATCH] Program: Save override phases to BYAML For debugging purposes, just in case. --- Rotationator/OverridePhase.cs | 11 +++++++++++ Rotationator/Program.cs | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Rotationator/OverridePhase.cs b/Rotationator/OverridePhase.cs index a572738..957dc5d 100644 --- a/Rotationator/OverridePhase.cs +++ b/Rotationator/OverridePhase.cs @@ -25,4 +25,15 @@ public class OverridePhase get; set; } + + public Dictionary ToByamlCompatibleFormat() + { + return new Dictionary() + { + { "Length", Length }, + { "RegularStages", RegularStages }, + { "GachiRule", GachiRule.ToEnumString() }, + { "GachiStages", GachiStages } + }; + } } \ No newline at end of file diff --git a/Rotationator/Program.cs b/Rotationator/Program.cs index a30aa68..bdc3a22 100644 --- a/Rotationator/Program.cs +++ b/Rotationator/Program.cs @@ -302,7 +302,13 @@ void Run(InvocationContext context) { "Generator", "Rotationator 1" }, { "GenerationTime", referenceNow.ToString("O") }, { "BaseByamlStartTime", baseTime.ToString("O") }, - { "RandomSeed", seed.ToString() } + { "RandomSeed", seed.ToString() }, + { + "OverridePhases", + overridePhases.Select(p => + new KeyValuePair(p.Key.ToString("O"), p.Value.ToByamlCompatibleFormat())) + .ToDictionary() + } }; ByamlFile.Save(outputByamlPath, lastByaml, new ByamlSerializerSettings()