MachineType is common, add Logiqx header values

This commit is contained in:
Matt Nadareski
2020-08-20 15:39:32 -07:00
parent 5ef365249f
commit e65b45b80f
9 changed files with 145 additions and 82 deletions

View File

@@ -25,6 +25,7 @@ namespace SabreTools.Library.DatItems
/// <summary>
/// Additional notes
/// </summary>
/// <remarks>Known as "Extra" in AttractMode</remarks>
[JsonProperty("comment")]
public string Comment { get; set; } = null;
@@ -76,6 +77,12 @@ namespace SabreTools.Library.DatItems
[JsonProperty("sampleof")]
public string SampleOf { get; set; } = null;
/// <summary>
/// Type of the machine
/// </summary>
[JsonProperty("type")]
public MachineType MachineType { get; set; } = MachineType.NULL;
#endregion
#region AttractMode Fields
@@ -129,6 +136,7 @@ namespace SabreTools.Library.DatItems
/// <summary>
/// Emulator source file related to the machine
/// </summary>
/// <remarks>Also in Logiqx</remarks>
[JsonProperty("sourcefile")]
public string SourceFile { get; set; } = null;
@@ -136,6 +144,7 @@ namespace SabreTools.Library.DatItems
/// Machine runnable status
/// </summary>
/// <remarks>yes = true, partial = null, no = false</remarks>
/// <remarks>Also in Logiqx</remarks>
[JsonProperty("runnable")]
public bool? Runnable { get; set; } = null;
@@ -157,12 +166,6 @@ namespace SabreTools.Library.DatItems
[JsonProperty("infos")]
public List<KeyValuePair<string, string>> Infos { get; set; } = null;
/// <summary>
/// Type of the machine
/// </summary>
[JsonProperty("type")]
public MachineType MachineType { get; set; } = MachineType.NULL;
#endregion
#region Logiqx Fields
@@ -239,6 +242,9 @@ namespace SabreTools.Library.DatItems
case Field.SampleOf:
fieldValue = SampleOf;
break;
case Field.MachineType:
fieldValue = MachineType.ToString();
break;
// AttractMode
case Field.Players:
@@ -279,9 +285,6 @@ namespace SabreTools.Library.DatItems
case Field.Infos:
fieldValue = string.Join(";", (Infos ?? new List<KeyValuePair<string, string>>()).Select(i => $"{i.Key}={i.Value}"));
break;
case Field.MachineType:
fieldValue = MachineType.ToString();
break;
// Logiqx
case Field.Board:
@@ -645,6 +648,9 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.SampleOf))
SampleOf = null;
if (fields.Contains(Field.MachineType))
MachineType = MachineType.NULL;
#endregion
#region AttractMode
@@ -689,9 +695,6 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.Infos))
Infos = null;
if (fields.Contains(Field.MachineType))
MachineType = MachineType.NULL;
#endregion
#region Logiqx
@@ -759,6 +762,9 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.SampleOf))
SampleOf = machine.SampleOf;
if (fields.Contains(Field.MachineType))
MachineType = machine.MachineType;
#endregion
#region AttractMode
@@ -803,9 +809,6 @@ namespace SabreTools.Library.DatItems
if (fields.Contains(Field.Infos))
Infos = machine.Infos;
if (fields.Contains(Field.MachineType))
MachineType = machine.MachineType;
#endregion
#region Logiqx