From cb44f1a509004393bfee1522ab67f22cca14ab05 Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Tue, 21 Feb 2023 10:12:23 +1100 Subject: [PATCH] refactor: moved development status to the rom object --- gaseous-identifier/Classes/TosecParser.cs | 14 +++++++------- gaseous-identifier/Objects/RomSignatureObject.cs | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gaseous-identifier/Classes/TosecParser.cs b/gaseous-identifier/Classes/TosecParser.cs index 141c949..27c438b 100644 --- a/gaseous-identifier/Classes/TosecParser.cs +++ b/gaseous-identifier/Classes/TosecParser.cs @@ -330,12 +330,6 @@ namespace gaseous_identifier.classes { gameObject.Copyright = new KeyValuePair(token, TOSECCopyright[token]); } - - // check for copyright - if (TOSECDevelopment.ContainsKey(token)) - { - gameObject.DevelopmentStatus = new KeyValuePair(token, TOSECDevelopment[token]); - } } } StartToken += 1; @@ -368,6 +362,12 @@ namespace gaseous_identifier.classes // replace the extra closing bracket string token = tokenSplit[0].Replace(")", "").Trim(); + // check for copyright + if (TOSECDevelopment.ContainsKey(token)) + { + romObject.DevelopmentStatus = new KeyValuePair(token, TOSECDevelopment[token]); + } + // check for media type if (token.StartsWith("Disc") || token.StartsWith("Disk") || @@ -412,7 +412,7 @@ namespace gaseous_identifier.classes token != gameObject.Country.Key && token != gameObject.Copyright.Key && token != gameObject.Language.Key && - token != gameObject.DevelopmentStatus.Key + token != romObject.DevelopmentStatus.Key ) ) { diff --git a/gaseous-identifier/Objects/RomSignatureObject.cs b/gaseous-identifier/Objects/RomSignatureObject.cs index 5bd39ee..4464e65 100644 --- a/gaseous-identifier/Objects/RomSignatureObject.cs +++ b/gaseous-identifier/Objects/RomSignatureObject.cs @@ -37,7 +37,6 @@ namespace gaseous_identifier.objects public KeyValuePair Country { get; set; } public KeyValuePair Language { get; set; } public KeyValuePair Copyright { get; set; } - public KeyValuePair DevelopmentStatus { get; set; } public List Roms { get; set; } = new List(); public enum DemoTypes @@ -58,6 +57,8 @@ namespace gaseous_identifier.objects public string? Md5 { get; set; } public string? Sha1 { get; set; } + public KeyValuePair DevelopmentStatus { get; set; } + public List flags { get; set; } = new List(); public RomTypes RomType { get; set; }