From ca5199b64d4d0b3675c0008d79182deff261db3e Mon Sep 17 00:00:00 2001 From: Manu <52102823+Manu098vm@users.noreply.github.com> Date: Sun, 5 Mar 2023 12:27:32 +0100 Subject: [PATCH] improved string descriptions --- .../Classes/BCATManager/BCATManager.cs | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/SwitchGiftDataManager.Core/Classes/BCATManager/BCATManager.cs b/SwitchGiftDataManager.Core/Classes/BCATManager/BCATManager.cs index 7dc663d..676bd44 100644 --- a/SwitchGiftDataManager.Core/Classes/BCATManager/BCATManager.cs +++ b/SwitchGiftDataManager.Core/Classes/BCATManager/BCATManager.cs @@ -162,9 +162,9 @@ namespace SwitchGiftDataManager.Core if (content!.GetType() == typeof(PokemonGift)) { var c = (PokemonGift)content; - el1 = c.ShinyType.ToString(); + el1 = GetShinyString(c.ShinyType); el2 = c.GetSpeciesName(); - el3 = c.PIDType.ToString(); + el3 = GetPIDString(c.PIDType); } else if (content!.GetType() == typeof(List)) { @@ -172,7 +172,7 @@ namespace SwitchGiftDataManager.Core { var item = c.GetItemName().Replace("\r",""); var qty = c.Quantity; - var str = $"{item.Replace("BP", "Battle Points")}"; + var str = $"{item.Replace("BP", "Battle Points").Replace("LP", "League Points")}"; if (qty != 0x0 && qty != 0xFFFF) str = $"{str} x{qty}"; if (el1.Equals("")) @@ -192,7 +192,6 @@ namespace SwitchGiftDataManager.Core } } } - return new List { wcid, el1, el2, el3, el4, el5, el6, el7 }; } @@ -336,5 +335,28 @@ namespace SwitchGiftDataManager.Core data.ToArray().CopyTo(filesDotMeta, MetaHeaderLength); return filesDotMeta.AsSpan(); } + + private string GetShinyString(ShinyType type) + { + return type switch + { + ShinyType.ShinyLocked => "Shiny Locked", + ShinyType.ShinyPossible => "Shiny Standard Odds", + ShinyType.ShinyHighOdds => "Shiny High Odds", + ShinyType.ShinyForced => "Shiny Forced", + ShinyType.ShinyTIDAbuse => "Shiny Possible (TID Abuse)", + _ => throw new IndexOutOfRangeException() + }; + } + + private string GetPIDString(PIDType type) + { + return type switch + { + PIDType.FixedPID => "Fixed PID", + PIDType.RandomPID => "Random PID", + _ => throw new IndexOutOfRangeException() + }; + } } }