mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
MachineType is common, add Logiqx header values
This commit is contained in:
@@ -227,6 +227,15 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx
|
||||
|
||||
case "build":
|
||||
content = jtr.ReadAsString();
|
||||
Header.Build = (Header.Build == null ? content : Header.Build);
|
||||
break;
|
||||
|
||||
#endregion
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -341,6 +350,24 @@ namespace SabreTools.Library.DatFiles
|
||||
break;
|
||||
case "sampleof":
|
||||
machine.SampleOf = jtr.ReadAsString();
|
||||
break;
|
||||
case "isbios":
|
||||
string isbios = jtr.ReadAsString();
|
||||
if (string.Equals(isbios, "yes", StringComparison.OrdinalIgnoreCase))
|
||||
machine.MachineType &= MachineType.Bios;
|
||||
|
||||
break;
|
||||
case "isdevice":
|
||||
string isdevice = jtr.ReadAsString();
|
||||
if (string.Equals(isdevice, "yes", StringComparison.OrdinalIgnoreCase))
|
||||
machine.MachineType &= MachineType.Device;
|
||||
|
||||
break;
|
||||
case "ismechanical":
|
||||
string ismechanical = jtr.ReadAsString();
|
||||
if (string.Equals(ismechanical, "yes", StringComparison.OrdinalIgnoreCase))
|
||||
machine.MachineType &= MachineType.Mechanical;
|
||||
|
||||
break;
|
||||
case "items":
|
||||
ReadItems(sr, jtr, filename, indexId, machine);
|
||||
@@ -412,24 +439,6 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
break;
|
||||
case "isbios":
|
||||
string isbios = jtr.ReadAsString();
|
||||
if (string.Equals(isbios, "yes", StringComparison.OrdinalIgnoreCase))
|
||||
machine.MachineType &= MachineType.Bios;
|
||||
|
||||
break;
|
||||
case "isdevice":
|
||||
string isdevice = jtr.ReadAsString();
|
||||
if (string.Equals(isdevice, "yes", StringComparison.OrdinalIgnoreCase))
|
||||
machine.MachineType &= MachineType.Device;
|
||||
|
||||
break;
|
||||
case "ismechanical":
|
||||
string ismechanical = jtr.ReadAsString();
|
||||
if (string.Equals(ismechanical, "yes", StringComparison.OrdinalIgnoreCase))
|
||||
machine.MachineType &= MachineType.Mechanical;
|
||||
|
||||
break;
|
||||
|
||||
// Logiqx
|
||||
case "board":
|
||||
@@ -1023,6 +1032,16 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(Header.Build))
|
||||
{
|
||||
jtw.WritePropertyName("build");
|
||||
jtw.WriteValue(Header.Build);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// End header
|
||||
jtw.WriteEndObject();
|
||||
|
||||
@@ -1105,6 +1124,24 @@ namespace SabreTools.Library.DatFiles
|
||||
jtw.WritePropertyName("sampleof");
|
||||
jtw.WriteValue(datItem.Machine.SampleOf);
|
||||
}
|
||||
if (!Header.ExcludeFields.Contains(Field.MachineType))
|
||||
{
|
||||
if (datItem.Machine.MachineType.HasFlag(MachineType.Bios))
|
||||
{
|
||||
jtw.WritePropertyName("isbios");
|
||||
jtw.WriteValue("yes");
|
||||
}
|
||||
if (datItem.Machine.MachineType.HasFlag(MachineType.Device))
|
||||
{
|
||||
jtw.WritePropertyName("isdevice");
|
||||
jtw.WriteValue("yes");
|
||||
}
|
||||
if (datItem.Machine.MachineType.HasFlag(MachineType.Mechanical))
|
||||
{
|
||||
jtw.WritePropertyName("ismechanical");
|
||||
jtw.WriteValue("yes");
|
||||
}
|
||||
}
|
||||
|
||||
// AttractMode
|
||||
if (!string.IsNullOrWhiteSpace(datItem.GetField(Field.Players, Header.ExcludeFields)))
|
||||
@@ -1198,24 +1235,6 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
jtw.WriteEndArray();
|
||||
}
|
||||
if (!Header.ExcludeFields.Contains(Field.MachineType))
|
||||
{
|
||||
if (datItem.Machine.MachineType.HasFlag(MachineType.Bios))
|
||||
{
|
||||
jtw.WritePropertyName("isbios");
|
||||
jtw.WriteValue("yes");
|
||||
}
|
||||
if (datItem.Machine.MachineType.HasFlag(MachineType.Device))
|
||||
{
|
||||
jtw.WritePropertyName("isdevice");
|
||||
jtw.WriteValue("yes");
|
||||
}
|
||||
if (datItem.Machine.MachineType.HasFlag(MachineType.Mechanical))
|
||||
{
|
||||
jtw.WritePropertyName("ismechanical");
|
||||
jtw.WriteValue("yes");
|
||||
}
|
||||
}
|
||||
|
||||
// Logiqx
|
||||
if (!string.IsNullOrWhiteSpace(datItem.GetField(Field.Board, Header.ExcludeFields)))
|
||||
|
||||
Reference in New Issue
Block a user