From 6b2496c4d529dc21af4ecd078d23370905f53b84 Mon Sep 17 00:00:00 2001 From: AnOddDoorKnight Date: Mon, 22 Aug 2022 14:51:49 -0700 Subject: [PATCH] Added a title and additional minor conversion info not related to goldpackage. --- Gold Splitter.csproj | 2 +- Program.cs | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Gold Splitter.csproj b/Gold Splitter.csproj index 72606bf..255a855 100644 --- a/Gold Splitter.csproj +++ b/Gold Splitter.csproj @@ -9,7 +9,7 @@ Gold Splitter Allows you to do some commands to ease up calculating on gold in Pathfinder 2e! https://github.com/AnOddDoorKnight/Gold-Splitter - 1.1.0 + 1.1.1 $(VersionPrefix) $(VersionPrefix) GoldSplitter.Program diff --git a/Program.cs b/Program.cs index dc184ea..dbaff5a 100644 --- a/Program.cs +++ b/Program.cs @@ -53,15 +53,37 @@ internal static class Program throw new InvalidOperationException(); } }), + new ("Stabilize, Takes some values higher than ten and puts them as their higher counterparts.", package => + { + Console.WriteLine(package.DisperseToAppropriateCoinValues()); + }), }; static void Main() { - GoldPackage gold = GoldPackage.HumanInput(); + PrintTitle(); + Console.WriteLine("[1] Use raw copper values, [2] Use a 'package'"); + GoldPackage gold; + switch (int.Parse(Console.ReadLine() ?? "1")) + { + case 1: + Console.Write("Copper: "); + gold = new GoldPackage(0, 0, 0, int.Parse(Console.ReadLine() ?? "0")); + break; + case 2: + gold = GoldPackage.HumanInput(); + break; + default: + throw new IndexOutOfRangeException(); + } Console.WriteLine("Choose an action:"); for (int i = 0; i < actions.Length; i++) Console.WriteLine($"{i + 1}. {actions[i].Name}"); actions[int.Parse(Console.ReadLine() ?? "0") - 1].Action.Invoke(gold); Console.ReadLine(); } + static void PrintTitle() + { + Console.Title = "Gold Splitter : https://github.com/AnOddDoorKnight/Gold-Splitter"; + } } public record NamedAction(string Name, Action Action); \ No newline at end of file