[Structs] Add Machine struct

This commit is contained in:
Matt Nadareski
2016-08-29 13:41:42 -07:00
parent 833231bddc
commit 5c0b5bfcbb
8 changed files with 139 additions and 82 deletions

View File

@@ -46,8 +46,7 @@ namespace SabreTools.Helper
/// </summary>
public struct Rom : IComparable, IEquatable<Rom>
{
public string Game;
public string GameDescription;
public Machine Game;
public string Name;
public string Type;
public HashData HashData;
@@ -67,7 +66,7 @@ namespace SabreTools.Helper
{
Rom comp = (Rom)obj;
if (this.Game == comp.Game)
if (this.Game.Name == comp.Game.Name)
{
if (this.Name == comp.Name)
{
@@ -75,7 +74,7 @@ namespace SabreTools.Helper
}
ret = String.Compare(this.Name, comp.Name);
}
ret = String.Compare(this.Game, comp.Game);
ret = String.Compare(this.Game.Name, comp.Game.Name);
}
catch
{
@@ -93,7 +92,7 @@ namespace SabreTools.Helper
bool isdupe = RomTools.IsDuplicate(this, other, temp);
temp.Close();
return (this.Game == other.Game &&
return (this.Game.Name == other.Game.Name &&
this.Name == other.Name &&
isdupe);
}
@@ -110,6 +109,25 @@ namespace SabreTools.Helper
public string Source;
}
/// <summary>
/// Intermediate struct for holding and processing Rom/Machine data
/// </summary>
public struct Machine
{
public string Name;
public string Comment;
public string Description;
public string Year;
public string Manufacturer;
public string RomOf;
public string CloneOf;
public string SampleOf;
public string SourceFile;
public bool IsBios;
public string Board;
public string RebuildTo;
}
/// <summary>
/// Intermediate struct for holding DAT information
/// </summary>