Wire up remaining OpenMSX machine fields

This commit is contained in:
Matt Nadareski
2020-08-21 17:27:11 -07:00
parent 755b6f030b
commit c3cde1f8e2
8 changed files with 258 additions and 10 deletions

View File

@@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using SabreTools.Library.Filtering;
using Newtonsoft.Json;
using SabreTools.Library.Tools;
using Newtonsoft.Json;
namespace SabreTools.Library.DatItems
{
@@ -245,6 +245,28 @@ namespace SabreTools.Library.DatItems
#endregion
#region OpenMSX Fields
/// <summary>
/// Generation MSX ID
/// </summary>
[JsonProperty("genmsxid")]
public string GenMSXID { get; set; } = null;
/// <summary>
/// MSX System
/// </summary>
[JsonProperty("system")]
public string System { get; set; } = null;
/// <summary>
/// Machine country of origin
/// </summary>
[JsonProperty("country")]
public string Country { get; set; } = null;
#endregion
#region SoftwareList Fields
/// <summary>
@@ -412,6 +434,20 @@ namespace SabreTools.Library.DatItems
#endregion
#region OpenMSX
case Field.GenMSXID:
fieldValue = GenMSXID;
break;
case Field.System:
fieldValue = System;
break;
case Field.Country:
fieldValue = Country;
break;
#endregion
#region SoftwareList
case Field.Supported:
@@ -588,6 +624,19 @@ namespace SabreTools.Library.DatItems
#endregion
#region OpenMSX
if (mappings.Keys.Contains(Field.GenMSXID))
GenMSXID = mappings[Field.GenMSXID];
if (mappings.Keys.Contains(Field.System))
System = mappings[Field.System];
if (mappings.Keys.Contains(Field.Country))
Country = mappings[Field.Country];
#endregion
#region SoftwareList
if (mappings.Keys.Contains(Field.Supported))
@@ -710,6 +759,14 @@ namespace SabreTools.Library.DatItems
#endregion
#region OpenMSX
GenMSXID = this.GenMSXID,
System = this.System,
Country = this.Country,
#endregion
#region SoftwareList
Supported = this.Supported,
@@ -976,6 +1033,28 @@ namespace SabreTools.Library.DatItems
#endregion
#region OpenMSX
// Filter on Generation MSX ID
if (filter.GenMSXID.MatchesPositiveSet(GenMSXID) == false)
return false;
if (filter.GenMSXID.MatchesNegativeSet(GenMSXID) == true)
return false;
// Filter on system
if (filter.System.MatchesPositiveSet(System) == false)
return false;
if (filter.System.MatchesNegativeSet(System) == true)
return false;
// Filter on country
if (filter.Country.MatchesPositiveSet(Country) == false)
return false;
if (filter.Country.MatchesNegativeSet(Country) == true)
return false;
#endregion
#region SoftwareList
// Filter on supported
@@ -1115,6 +1194,19 @@ namespace SabreTools.Library.DatItems
#endregion
#region OpenMSX
if (fields.Contains(Field.GenMSXID))
GenMSXID = null;
if (fields.Contains(Field.System))
System = null;
if (fields.Contains(Field.Country))
Country = null;
#endregion
#region SoftwareList
if (fields.Contains(Field.Supported))
@@ -1266,6 +1358,19 @@ namespace SabreTools.Library.DatItems
#endregion
#region OpenMSX
if (fields.Contains(Field.GenMSXID))
GenMSXID = machine.GenMSXID;
if (fields.Contains(Field.System))
System = machine.System;
if (fields.Contains(Field.Country))
Country = machine.Country;
#endregion
#region SoftwareList
if (fields.Contains(Field.Supported))