chore: separated components into separate projects
This commit is contained in:
22
Gaseous.sln
22
Gaseous.sln
@@ -1,11 +1,13 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 16
|
||||||
VisualStudioVersion = 25.0.1704.4
|
VisualStudioVersion = 25.0.1704.4
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaseous-identifier-testapp", "gaseous-identifier\gaseous-identifier-testapp.csproj", "{F5C42134-5372-430A-A9AE-1871981850DB}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaseous-identifier-testapp", "gaseous-identifier\gaseous-identifier-testapp.csproj", "{F5C42134-5372-430A-A9AE-1871981850DB}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaseous-romsignatureobject", "gaseous-romsignatureobject\Gaseous-ROMSignatureObject.csproj", "{B0328A09-F50C-40BB-AC3D-040635AF927F}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaseous-signature-parser", "gaseous-signature-parser\gaseous-signature-parser.csproj", "{DAEBBB82-5051-43FD-A406-F9D64A38F468}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaseous-romsignatureobject", "gaseous-romsignatureobject\gaseous-romsignatureobject.csproj", "{9DCD243D-37CE-4562-8411-B5242B687D4F}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -21,10 +23,18 @@ Global
|
|||||||
{08699C93-15CD-4E39-9053-D3C8056CE938}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{08699C93-15CD-4E39-9053-D3C8056CE938}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{08699C93-15CD-4E39-9053-D3C8056CE938}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{08699C93-15CD-4E39-9053-D3C8056CE938}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{08699C93-15CD-4E39-9053-D3C8056CE938}.Release|Any CPU.Build.0 = Release|Any CPU
|
{08699C93-15CD-4E39-9053-D3C8056CE938}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{B0328A09-F50C-40BB-AC3D-040635AF927F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{DAEBBB82-5051-43FD-A406-F9D64A38F468}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{B0328A09-F50C-40BB-AC3D-040635AF927F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{DAEBBB82-5051-43FD-A406-F9D64A38F468}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{B0328A09-F50C-40BB-AC3D-040635AF927F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{DAEBBB82-5051-43FD-A406-F9D64A38F468}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{B0328A09-F50C-40BB-AC3D-040635AF927F}.Release|Any CPU.Build.0 = Release|Any CPU
|
{DAEBBB82-5051-43FD-A406-F9D64A38F468}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{9DCD243D-37CE-4562-8411-B5242B687D4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{9DCD243D-37CE-4562-8411-B5242B687D4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{9DCD243D-37CE-4562-8411-B5242B687D4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{9DCD243D-37CE-4562-8411-B5242B687D4F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@@ -4,6 +4,8 @@ using System.Text;
|
|||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using gaseous_romsignatureobject;
|
||||||
|
using gaseous_signature_parser.parsers;
|
||||||
|
|
||||||
string[] commandLineArgs = Environment.GetCommandLineArgs();
|
string[] commandLineArgs = Environment.GetCommandLineArgs();
|
||||||
|
|
||||||
@@ -50,7 +52,7 @@ foreach (string commandLineArg in commandLineArgs)
|
|||||||
scanPath = Path.GetFullPath(scanPath);
|
scanPath = Path.GetFullPath(scanPath);
|
||||||
Console.WriteLine("ROM search path: " + scanPath);
|
Console.WriteLine("ROM search path: " + scanPath);
|
||||||
|
|
||||||
List<Gaseous_ROMSignatureObject.RomSignatureObject> romSignatures = new List<Gaseous_ROMSignatureObject.RomSignatureObject>();
|
List<RomSignatureObject> romSignatures = new List<RomSignatureObject>();
|
||||||
System.Collections.ArrayList availablePlatforms = new System.Collections.ArrayList();
|
System.Collections.ArrayList availablePlatforms = new System.Collections.ArrayList();
|
||||||
|
|
||||||
// load TOSEC XML files
|
// load TOSEC XML files
|
||||||
@@ -66,14 +68,14 @@ if (tosecXML != null && tosecXML.Length > 0)
|
|||||||
{
|
{
|
||||||
string tosecXMLFile = tosecPathContents[i];
|
string tosecXMLFile = tosecPathContents[i];
|
||||||
|
|
||||||
gaseous_identifier.classes.TosecParser tosecParser = new gaseous_identifier.classes.TosecParser();
|
TosecParser tosecParser = new TosecParser();
|
||||||
Gaseous_ROMSignatureObject.RomSignatureObject tosecObject = tosecParser.Parse(tosecXMLFile);
|
RomSignatureObject tosecObject = tosecParser.Parse(tosecXMLFile);
|
||||||
|
|
||||||
string statusOutput = i + " / " + tosecPathContents.Length + " : " + Path.GetFileName(tosecXMLFile);
|
string statusOutput = i + " / " + tosecPathContents.Length + " : " + Path.GetFileName(tosecXMLFile);
|
||||||
Console.Write("\r " + statusOutput.PadRight(lastCLILineLength, ' ') + "\r");
|
Console.Write("\r " + statusOutput.PadRight(lastCLILineLength, ' ') + "\r");
|
||||||
lastCLILineLength = statusOutput.Length;
|
lastCLILineLength = statusOutput.Length;
|
||||||
|
|
||||||
foreach (Gaseous_ROMSignatureObject.RomSignatureObject.Game gameRom in tosecObject.Games)
|
foreach (RomSignatureObject.Game gameRom in tosecObject.Games)
|
||||||
{
|
{
|
||||||
if (!availablePlatforms.Contains(gameRom.System))
|
if (!availablePlatforms.Contains(gameRom.System))
|
||||||
{
|
{
|
||||||
@@ -118,11 +120,11 @@ foreach (string romFile in romPathContents)
|
|||||||
string sha1Hash = BitConverter.ToString(sha1HashByte).Replace("-", "").ToLowerInvariant();
|
string sha1Hash = BitConverter.ToString(sha1HashByte).Replace("-", "").ToLowerInvariant();
|
||||||
|
|
||||||
bool gameFound = false;
|
bool gameFound = false;
|
||||||
foreach (Gaseous_ROMSignatureObject.RomSignatureObject tosecList in romSignatures)
|
foreach (RomSignatureObject tosecList in romSignatures)
|
||||||
{
|
{
|
||||||
foreach (Gaseous_ROMSignatureObject.RomSignatureObject.Game gameObject in tosecList.Games)
|
foreach (RomSignatureObject.Game gameObject in tosecList.Games)
|
||||||
{
|
{
|
||||||
foreach (Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom romObject in gameObject.Roms)
|
foreach (RomSignatureObject.Game.Rom romObject in gameObject.Roms)
|
||||||
{
|
{
|
||||||
if (romObject.Md5 != null)
|
if (romObject.Md5 != null)
|
||||||
{
|
{
|
||||||
@@ -144,7 +146,7 @@ foreach (string romFile in romPathContents)
|
|||||||
{
|
{
|
||||||
Console.WriteLine(romObject.Name);
|
Console.WriteLine(romObject.Name);
|
||||||
|
|
||||||
Gaseous_ROMSignatureObject.RomSignatureObject.Game gameSignature = gameObject;
|
RomSignatureObject.Game gameSignature = gameObject;
|
||||||
gameSignature.Roms.Clear();
|
gameSignature.Roms.Clear();
|
||||||
gameSignature.Roms.Add(romObject);
|
gameSignature.Roms.Add(romObject);
|
||||||
|
|
||||||
@@ -166,9 +168,9 @@ foreach (string romFile in romPathContents)
|
|||||||
}
|
}
|
||||||
|
|
||||||
string SearchTitle = "California Games";
|
string SearchTitle = "California Games";
|
||||||
foreach (Gaseous_ROMSignatureObject.RomSignatureObject romSignatureObject in romSignatures)
|
foreach (RomSignatureObject romSignatureObject in romSignatures)
|
||||||
{
|
{
|
||||||
foreach (Gaseous_ROMSignatureObject.RomSignatureObject.Game gameObject in romSignatureObject.Games)
|
foreach (RomSignatureObject.Game gameObject in romSignatureObject.Games)
|
||||||
{
|
{
|
||||||
if (gameObject.Name == SearchTitle)
|
if (gameObject.Name == SearchTitle)
|
||||||
{
|
{
|
||||||
|
@@ -9,36 +9,13 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Classes\" />
|
|
||||||
<None Remove="Support\" />
|
|
||||||
<None Remove="Support\Parsers\" />
|
|
||||||
<None Remove="Support\Parsers\TOSEC\" />
|
|
||||||
<None Remove="Support\Parsers\TOSEC\Systems.txt" />
|
|
||||||
<None Remove="Support\Parsers\TOSEC\Video.txt" />
|
|
||||||
<None Remove="Support\Parsers\TOSEC\Country.txt" />
|
|
||||||
<None Remove="Support\Parsers\TOSEC\Language.txt" />
|
|
||||||
<None Remove="Support\Parsers\TOSEC\Copyright.txt" />
|
|
||||||
<None Remove="Support\Parsers\TOSEC\DevelopmentStatus.txt" />
|
|
||||||
<None Remove="Newtonsoft.Json" />
|
<None Remove="Newtonsoft.Json" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Classes\" />
|
|
||||||
<Folder Include="Support\" />
|
|
||||||
<Folder Include="Support\Parsers\" />
|
|
||||||
<Folder Include="Support\Parsers\TOSEC\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Support\Parsers\TOSEC\Systems.txt" />
|
|
||||||
<EmbeddedResource Include="Support\Parsers\TOSEC\Video.txt" />
|
|
||||||
<EmbeddedResource Include="Support\Parsers\TOSEC\Country.txt" />
|
|
||||||
<EmbeddedResource Include="Support\Parsers\TOSEC\Language.txt" />
|
|
||||||
<EmbeddedResource Include="Support\Parsers\TOSEC\Copyright.txt" />
|
|
||||||
<EmbeddedResource Include="Support\Parsers\TOSEC\DevelopmentStatus.txt" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\gaseous-romsignatureobject\Gaseous-ROMSignatureObject.csproj" />
|
<ProjectReference Include="..\gaseous-romsignatureobject\gaseous-romsignatureobject.csproj" />
|
||||||
|
<ProjectReference Include="..\gaseous-signature-parser\gaseous-signature-parser.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -1,10 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<RootNamespace>Gaseous_ROMSignatureObject</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Gaseous_ROMSignatureObject
|
namespace gaseous_romsignatureobject
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Object returned by all signature engines containing metadata about the ROM's in the data files
|
/// Object returned by all signature engines containing metadata about the ROM's in the data files
|
||||||
|
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<RootNamespace>Gaseous_ROMSignatureObject</RootNamespace>
|
<RootNamespace>gaseous_romsignatureobject</RootNamespace>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -3,18 +3,19 @@ using System.Xml;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
using gaseous_romsignatureobject;
|
||||||
|
|
||||||
namespace gaseous_identifier.classes
|
namespace gaseous_signature_parser.parsers
|
||||||
{
|
{
|
||||||
public class TosecParser
|
public class TosecParser
|
||||||
{
|
{
|
||||||
public Gaseous_ROMSignatureObject.RomSignatureObject Parse(string XMLFile)
|
public RomSignatureObject Parse(string XMLFile)
|
||||||
{
|
{
|
||||||
// load resources
|
// load resources
|
||||||
var assembly = Assembly.GetExecutingAssembly();
|
var assembly = Assembly.GetExecutingAssembly();
|
||||||
// load systems list
|
// load systems list
|
||||||
List<string> TOSECSystems = new List<string>();
|
List<string> TOSECSystems = new List<string>();
|
||||||
var resourceName = "gaseous_identifier.Support.Parsers.TOSEC.Systems.txt";
|
var resourceName = "gaseous_signature_parser.Support.Parsers.TOSEC.Systems.txt";
|
||||||
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
||||||
using (StreamReader reader = new StreamReader(stream))
|
using (StreamReader reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
@@ -22,7 +23,7 @@ namespace gaseous_identifier.classes
|
|||||||
}
|
}
|
||||||
// load video list
|
// load video list
|
||||||
List<string> TOSECVideo = new List<string>();
|
List<string> TOSECVideo = new List<string>();
|
||||||
resourceName = "gaseous_identifier.Support.Parsers.TOSEC.Video.txt";
|
resourceName = "gaseous_signature_parser.Support.Parsers.TOSEC.Video.txt";
|
||||||
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
||||||
using (StreamReader reader = new StreamReader(stream))
|
using (StreamReader reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
@@ -30,7 +31,7 @@ namespace gaseous_identifier.classes
|
|||||||
}
|
}
|
||||||
// load country list
|
// load country list
|
||||||
Dictionary<string, string> TOSECCountry = new Dictionary<string, string>();
|
Dictionary<string, string> TOSECCountry = new Dictionary<string, string>();
|
||||||
resourceName = "gaseous_identifier.Support.Parsers.TOSEC.Country.txt";
|
resourceName = "gaseous_signature_parser.Support.Parsers.TOSEC.Country.txt";
|
||||||
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
||||||
using (StreamReader reader = new StreamReader(stream))
|
using (StreamReader reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
@@ -42,7 +43,7 @@ namespace gaseous_identifier.classes
|
|||||||
}
|
}
|
||||||
// load language list
|
// load language list
|
||||||
Dictionary<string, string> TOSECLanguage = new Dictionary<string, string>();
|
Dictionary<string, string> TOSECLanguage = new Dictionary<string, string>();
|
||||||
resourceName = "gaseous_identifier.Support.Parsers.TOSEC.Language.txt";
|
resourceName = "gaseous_signature_parser.Support.Parsers.TOSEC.Language.txt";
|
||||||
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
||||||
using (StreamReader reader = new StreamReader(stream))
|
using (StreamReader reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
@@ -54,7 +55,7 @@ namespace gaseous_identifier.classes
|
|||||||
}
|
}
|
||||||
// load copyright list
|
// load copyright list
|
||||||
Dictionary<string, string> TOSECCopyright = new Dictionary<string, string>();
|
Dictionary<string, string> TOSECCopyright = new Dictionary<string, string>();
|
||||||
resourceName = "gaseous_identifier.Support.Parsers.TOSEC.Copyright.txt";
|
resourceName = "gaseous_signature_parser.Support.Parsers.TOSEC.Copyright.txt";
|
||||||
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
||||||
using (StreamReader reader = new StreamReader(stream))
|
using (StreamReader reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
@@ -66,7 +67,7 @@ namespace gaseous_identifier.classes
|
|||||||
}
|
}
|
||||||
// load development status list
|
// load development status list
|
||||||
Dictionary<string, string> TOSECDevelopment = new Dictionary<string, string>();
|
Dictionary<string, string> TOSECDevelopment = new Dictionary<string, string>();
|
||||||
resourceName = "gaseous_identifier.Support.Parsers.TOSEC.DevelopmentStatus.txt";
|
resourceName = "gaseous_signature_parser.Support.Parsers.TOSEC.DevelopmentStatus.txt";
|
||||||
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
|
||||||
using (StreamReader reader = new StreamReader(stream))
|
using (StreamReader reader = new StreamReader(stream))
|
||||||
{
|
{
|
||||||
@@ -92,7 +93,7 @@ namespace gaseous_identifier.classes
|
|||||||
XmlDocument tosecXmlDoc = new XmlDocument();
|
XmlDocument tosecXmlDoc = new XmlDocument();
|
||||||
tosecXmlDoc.Load(XMLFile);
|
tosecXmlDoc.Load(XMLFile);
|
||||||
|
|
||||||
Gaseous_ROMSignatureObject.RomSignatureObject tosecObject = new Gaseous_ROMSignatureObject.RomSignatureObject();
|
RomSignatureObject tosecObject = new RomSignatureObject();
|
||||||
|
|
||||||
// get header
|
// get header
|
||||||
XmlNode xmlHeader = tosecXmlDoc.DocumentElement.SelectSingleNode("/datafile/header");
|
XmlNode xmlHeader = tosecXmlDoc.DocumentElement.SelectSingleNode("/datafile/header");
|
||||||
@@ -145,11 +146,11 @@ namespace gaseous_identifier.classes
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get games
|
// get games
|
||||||
tosecObject.Games = new List<Gaseous_ROMSignatureObject.RomSignatureObject.Game>();
|
tosecObject.Games = new List<RomSignatureObject.Game>();
|
||||||
XmlNodeList xmlGames = tosecXmlDoc.DocumentElement.SelectNodes("/datafile/game");
|
XmlNodeList xmlGames = tosecXmlDoc.DocumentElement.SelectNodes("/datafile/game");
|
||||||
foreach (XmlNode xmlGame in xmlGames)
|
foreach (XmlNode xmlGame in xmlGames)
|
||||||
{
|
{
|
||||||
Gaseous_ROMSignatureObject.RomSignatureObject.Game gameObject = new Gaseous_ROMSignatureObject.RomSignatureObject.Game();
|
RomSignatureObject.Game gameObject = new RomSignatureObject.Game();
|
||||||
|
|
||||||
// parse game name
|
// parse game name
|
||||||
string[] gameNameTitleParts = xmlGame.Attributes["name"].Value.Split("[");
|
string[] gameNameTitleParts = xmlGame.Attributes["name"].Value.Split("[");
|
||||||
@@ -158,32 +159,32 @@ namespace gaseous_identifier.classes
|
|||||||
// before split, save and remove the demo tag if present
|
// before split, save and remove the demo tag if present
|
||||||
if (gameName.Contains("(demo) ", StringComparison.CurrentCulture))
|
if (gameName.Contains("(demo) ", StringComparison.CurrentCulture))
|
||||||
{
|
{
|
||||||
gameObject.Demo = Gaseous_ROMSignatureObject.RomSignatureObject.Game.DemoTypes.demo;
|
gameObject.Demo = RomSignatureObject.Game.DemoTypes.demo;
|
||||||
gameName = gameName.Replace("(demo) ", "");
|
gameName = gameName.Replace("(demo) ", "");
|
||||||
}
|
}
|
||||||
else if (gameName.Contains("(demo-kiosk) ", StringComparison.CurrentCulture))
|
else if (gameName.Contains("(demo-kiosk) ", StringComparison.CurrentCulture))
|
||||||
{
|
{
|
||||||
gameObject.Demo = Gaseous_ROMSignatureObject.RomSignatureObject.Game.DemoTypes.demo_kiosk;
|
gameObject.Demo = RomSignatureObject.Game.DemoTypes.demo_kiosk;
|
||||||
gameName = gameName.Replace("(demo-kiosk) ", "");
|
gameName = gameName.Replace("(demo-kiosk) ", "");
|
||||||
}
|
}
|
||||||
else if (gameName.Contains("(demo-playable) ", StringComparison.CurrentCulture))
|
else if (gameName.Contains("(demo-playable) ", StringComparison.CurrentCulture))
|
||||||
{
|
{
|
||||||
gameObject.Demo = Gaseous_ROMSignatureObject.RomSignatureObject.Game.DemoTypes.demo_playable;
|
gameObject.Demo = RomSignatureObject.Game.DemoTypes.demo_playable;
|
||||||
gameName = gameName.Replace("(demo-playable) ", "");
|
gameName = gameName.Replace("(demo-playable) ", "");
|
||||||
}
|
}
|
||||||
else if (gameName.Contains("(demo-rolling) ", StringComparison.CurrentCulture))
|
else if (gameName.Contains("(demo-rolling) ", StringComparison.CurrentCulture))
|
||||||
{
|
{
|
||||||
gameObject.Demo = Gaseous_ROMSignatureObject.RomSignatureObject.Game.DemoTypes.demo_rolling;
|
gameObject.Demo = RomSignatureObject.Game.DemoTypes.demo_rolling;
|
||||||
gameName = gameName.Replace("(demo-rolling) ", "");
|
gameName = gameName.Replace("(demo-rolling) ", "");
|
||||||
}
|
}
|
||||||
else if (gameName.Contains("(demo-slideshow) ", StringComparison.CurrentCulture))
|
else if (gameName.Contains("(demo-slideshow) ", StringComparison.CurrentCulture))
|
||||||
{
|
{
|
||||||
gameObject.Demo = Gaseous_ROMSignatureObject.RomSignatureObject.Game.DemoTypes.demo_slideshow;
|
gameObject.Demo = RomSignatureObject.Game.DemoTypes.demo_slideshow;
|
||||||
gameName = gameName.Replace("(demo-slideshow) ", "");
|
gameName = gameName.Replace("(demo-slideshow) ", "");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gameObject.Demo = Gaseous_ROMSignatureObject.RomSignatureObject.Game.DemoTypes.NotDemo;
|
gameObject.Demo = RomSignatureObject.Game.DemoTypes.NotDemo;
|
||||||
}
|
}
|
||||||
|
|
||||||
string[] gameNameTokens = gameName.Split("(");
|
string[] gameNameTokens = gameName.Split("(");
|
||||||
@@ -336,7 +337,7 @@ namespace gaseous_identifier.classes
|
|||||||
StartToken += 1;
|
StartToken += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
gameObject.Roms = new List<Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom>();
|
gameObject.Roms = new List<RomSignatureObject.Game.Rom>();
|
||||||
|
|
||||||
// get the roms
|
// get the roms
|
||||||
string romDescription = "";
|
string romDescription = "";
|
||||||
@@ -349,7 +350,7 @@ namespace gaseous_identifier.classes
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case "rom":
|
case "rom":
|
||||||
Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom romObject = new Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom();
|
RomSignatureObject.Game.Rom romObject = new RomSignatureObject.Game.Rom();
|
||||||
romObject.Name = xmlGameDetail.Attributes["name"]?.Value;
|
romObject.Name = xmlGameDetail.Attributes["name"]?.Value;
|
||||||
romObject.Size = UInt64.Parse(xmlGameDetail.Attributes["size"]?.Value);
|
romObject.Size = UInt64.Parse(xmlGameDetail.Attributes["size"]?.Value);
|
||||||
romObject.Crc = xmlGameDetail.Attributes["crc"]?.Value;
|
romObject.Crc = xmlGameDetail.Attributes["crc"]?.Value;
|
||||||
@@ -382,22 +383,22 @@ namespace gaseous_identifier.classes
|
|||||||
switch (tokens[0])
|
switch (tokens[0])
|
||||||
{
|
{
|
||||||
case "Disc":
|
case "Disc":
|
||||||
romObject.RomType = Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom.RomTypes.Disc;
|
romObject.RomType = RomSignatureObject.Game.Rom.RomTypes.Disc;
|
||||||
break;
|
break;
|
||||||
case "Disk":
|
case "Disk":
|
||||||
romObject.RomType = Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom.RomTypes.Disk;
|
romObject.RomType = RomSignatureObject.Game.Rom.RomTypes.Disk;
|
||||||
break;
|
break;
|
||||||
case "File":
|
case "File":
|
||||||
romObject.RomType = Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom.RomTypes.File;
|
romObject.RomType = RomSignatureObject.Game.Rom.RomTypes.File;
|
||||||
break;
|
break;
|
||||||
case "Part":
|
case "Part":
|
||||||
romObject.RomType = Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom.RomTypes.Part;
|
romObject.RomType = RomSignatureObject.Game.Rom.RomTypes.Part;
|
||||||
break;
|
break;
|
||||||
case "Side":
|
case "Side":
|
||||||
romObject.RomType = Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom.RomTypes.Side;
|
romObject.RomType = RomSignatureObject.Game.Rom.RomTypes.Side;
|
||||||
break;
|
break;
|
||||||
case "Tape":
|
case "Tape":
|
||||||
romObject.RomType = Gaseous_ROMSignatureObject.RomSignatureObject.Game.Rom.RomTypes.Tape;
|
romObject.RomType = RomSignatureObject.Game.Rom.RomTypes.Tape;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
romObject.RomTypeMedia = token;
|
romObject.RomTypeMedia = token;
|
||||||
@@ -487,7 +488,7 @@ namespace gaseous_identifier.classes
|
|||||||
|
|
||||||
// search for existing gameObject to update
|
// search for existing gameObject to update
|
||||||
bool existingGameFound = false;
|
bool existingGameFound = false;
|
||||||
foreach (Gaseous_ROMSignatureObject.RomSignatureObject.Game existingGame in tosecObject.Games)
|
foreach (RomSignatureObject.Game existingGame in tosecObject.Games)
|
||||||
{
|
{
|
||||||
if (existingGame.Name == gameObject.Name &&
|
if (existingGame.Name == gameObject.Name &&
|
||||||
existingGame.Year == gameObject.Year &&
|
existingGame.Year == gameObject.Year &&
|
38
gaseous-signature-parser/gaseous-signature-parser.csproj
Normal file
38
gaseous-signature-parser/gaseous-signature-parser.csproj
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<RootNamespace>gaseous_signature_parser</RootNamespace>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Support\Parsers\TOSEC\Copyright.txt" />
|
||||||
|
<None Remove="Support\Parsers\TOSEC\Country.txt" />
|
||||||
|
<None Remove="Support\Parsers\TOSEC\DevelopmentStatus.txt" />
|
||||||
|
<None Remove="Support\Parsers\TOSEC\Language.txt" />
|
||||||
|
<None Remove="Support\Parsers\TOSEC\Systems.txt" />
|
||||||
|
<None Remove="Support\Parsers\TOSEC\Video.txt" />
|
||||||
|
<None Remove="Support\" />
|
||||||
|
<None Remove="Classes\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="Support\Parsers\TOSEC\Copyright.txt" />
|
||||||
|
<EmbeddedResource Include="Support\Parsers\TOSEC\Country.txt" />
|
||||||
|
<EmbeddedResource Include="Support\Parsers\TOSEC\DevelopmentStatus.txt" />
|
||||||
|
<EmbeddedResource Include="Support\Parsers\TOSEC\Language.txt" />
|
||||||
|
<EmbeddedResource Include="Support\Parsers\TOSEC\Systems.txt" />
|
||||||
|
<EmbeddedResource Include="Support\Parsers\TOSEC\Video.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Support\" />
|
||||||
|
<Folder Include="Classes\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\gaseous-romsignatureobject\gaseous-romsignatureobject.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
Reference in New Issue
Block a user