mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Promote Driver
This commit is contained in:
@@ -125,6 +125,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public long DiskCount { get; private set; } = 0;
|
public long DiskCount { get; private set; } = 0;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Number of Driver items
|
||||||
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
|
public long DriverCount { get; private set; } = 0;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Number of Feature items
|
/// Number of Feature items
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -539,6 +545,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
NodumpCount += ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
NodumpCount += ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
||||||
VerifiedCount += ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
|
VerifiedCount += ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Driver:
|
||||||
|
DriverCount++;
|
||||||
|
break;
|
||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
FeatureCount++;
|
FeatureCount++;
|
||||||
break;
|
break;
|
||||||
@@ -695,6 +704,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
NodumpCount -= ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
NodumpCount -= ((item as Disk).ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
||||||
VerifiedCount -= ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
|
VerifiedCount -= ((item as Disk).ItemStatus == ItemStatus.Verified ? 1 : 0);
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Driver:
|
||||||
|
DriverCount--;
|
||||||
|
break;
|
||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
FeatureCount--;
|
FeatureCount--;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -235,6 +235,9 @@ namespace SabreTools.Library.DatFiles
|
|||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
datItem = datItemObj.ToObject<Disk>();
|
datItem = datItemObj.ToObject<Disk>();
|
||||||
break;
|
break;
|
||||||
|
case ItemType.Driver:
|
||||||
|
datItem = datItemObj.ToObject<Driver>();
|
||||||
|
break;
|
||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
datItem = datItemObj.ToObject<Feature>();
|
datItem = datItemObj.ToObject<Feature>();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -289,6 +289,18 @@ namespace SabreTools.Library.DatFiles
|
|||||||
reader.Read();
|
reader.Read();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "driver":
|
||||||
|
datItems.Add(new Driver
|
||||||
|
{
|
||||||
|
Status = reader.GetAttribute("status").AsSupportStatus(),
|
||||||
|
Emulation = reader.GetAttribute("emulation").AsSupportStatus(),
|
||||||
|
Cocktail = reader.GetAttribute("cocktail").AsSupportStatus(),
|
||||||
|
SaveState = reader.GetAttribute("savestate").AsSupported(),
|
||||||
|
});
|
||||||
|
|
||||||
|
reader.Read();
|
||||||
|
break;
|
||||||
|
|
||||||
case "feature":
|
case "feature":
|
||||||
datItems.Add(new Feature
|
datItems.Add(new Feature
|
||||||
{
|
{
|
||||||
@@ -476,22 +488,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
reader.Skip();
|
reader.Skip();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "driver":
|
|
||||||
var driver = new Driver();
|
|
||||||
driver.Status = reader.GetAttribute("status");
|
|
||||||
driver.Emulation = reader.GetAttribute("emulation");
|
|
||||||
driver.Cocktail = reader.GetAttribute("cocktail");
|
|
||||||
driver.SaveState = reader.GetAttribute("savestate");
|
|
||||||
|
|
||||||
// Ensure the list exists
|
|
||||||
if (machine.Drivers == null)
|
|
||||||
machine.Drivers = new List<Driver>();
|
|
||||||
|
|
||||||
machine.Drivers.Add(driver);
|
|
||||||
|
|
||||||
reader.Read();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "device":
|
case "device":
|
||||||
var device = new Device();
|
var device = new Device();
|
||||||
device.Type = reader.GetAttribute("type");
|
device.Type = reader.GetAttribute("type");
|
||||||
@@ -1299,21 +1295,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (datItem.Machine.Drivers != null)
|
|
||||||
{
|
|
||||||
foreach (var driver in datItem.Machine.Drivers)
|
|
||||||
{
|
|
||||||
xtw.WriteStartElement("driver");
|
|
||||||
|
|
||||||
xtw.WriteOptionalAttributeString("status", driver.Status);
|
|
||||||
xtw.WriteOptionalAttributeString("emulation", driver.Emulation);
|
|
||||||
xtw.WriteOptionalAttributeString("cocktail", driver.Cocktail);
|
|
||||||
xtw.WriteOptionalAttributeString("savestate", driver.SaveState);
|
|
||||||
|
|
||||||
// End driver
|
|
||||||
xtw.WriteEndElement();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (datItem.Machine.Devices != null)
|
if (datItem.Machine.Devices != null)
|
||||||
{
|
{
|
||||||
foreach (var device in datItem.Machine.Devices)
|
foreach (var device in datItem.Machine.Devices)
|
||||||
@@ -1566,6 +1547,16 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ItemType.Driver:
|
||||||
|
var driver = datItem as Driver;
|
||||||
|
xtw.WriteStartElement("driver");
|
||||||
|
xtw.WriteOptionalAttributeString("status", driver.Status.FromSupportStatus());
|
||||||
|
xtw.WriteOptionalAttributeString("emulation", driver.Emulation.FromSupportStatus());
|
||||||
|
xtw.WriteOptionalAttributeString("cocktail", driver.Cocktail.FromSupportStatus());
|
||||||
|
xtw.WriteOptionalAttributeString("savestate", driver.SaveState.FromSupported(true));
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
break;
|
||||||
|
|
||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
var feature = datItem as Feature;
|
var feature = datItem as Feature;
|
||||||
xtw.WriteStartElement("feature");
|
xtw.WriteStartElement("feature");
|
||||||
|
|||||||
@@ -1389,6 +1389,17 @@ namespace SabreTools.Library.DatFiles
|
|||||||
xtw.WriteEndElement();
|
xtw.WriteEndElement();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ItemType.Driver:
|
||||||
|
var driver = datItem as Driver;
|
||||||
|
xtw.WriteStartElement("file");
|
||||||
|
xtw.WriteAttributeString("type", "driver");
|
||||||
|
xtw.WriteOptionalAttributeString("status", driver.Status.FromSupportStatus());
|
||||||
|
xtw.WriteOptionalAttributeString("emulation", driver.Emulation.FromSupportStatus());
|
||||||
|
xtw.WriteOptionalAttributeString("cocktail", driver.Cocktail.FromSupportStatus());
|
||||||
|
xtw.WriteOptionalAttributeString("savestate", driver.SaveState.FromSupported(true));
|
||||||
|
xtw.WriteEndElement();
|
||||||
|
break;
|
||||||
|
|
||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
var feature = datItem as Feature;
|
var feature = datItem as Feature;
|
||||||
xtw.WriteStartElement("file");
|
xtw.WriteStartElement("file");
|
||||||
|
|||||||
@@ -692,7 +692,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
if (!string.Equals(datItem.Machine.Name, datItem.Machine.CloneOf, StringComparison.OrdinalIgnoreCase))
|
if (!string.Equals(datItem.Machine.Name, datItem.Machine.CloneOf, StringComparison.OrdinalIgnoreCase))
|
||||||
xtw.WriteOptionalAttributeString("cloneof", datItem.Machine.CloneOf);
|
xtw.WriteOptionalAttributeString("cloneof", datItem.Machine.CloneOf);
|
||||||
|
|
||||||
xtw.WriteOptionalAttributeString("supported", datItem.Machine.Supported.FromSupported());
|
xtw.WriteOptionalAttributeString("supported", datItem.Machine.Supported.FromSupported(false));
|
||||||
|
|
||||||
xtw.WriteOptionalElementString("description", datItem.Machine.Description);
|
xtw.WriteOptionalElementString("description", datItem.Machine.Description);
|
||||||
xtw.WriteOptionalElementString("year", datItem.Machine.Year);
|
xtw.WriteOptionalElementString("year", datItem.Machine.Year);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This holds all of the auxiliary types needed for proper parsing
|
/// This holds all of the auxiliary types needed for proper parsing
|
||||||
@@ -163,26 +164,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
public string VBStart { get; set; } // TODO: Int32? Float?
|
public string VBStart { get; set; } // TODO: Int32? Float?
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents one ListXML driver
|
|
||||||
/// </summary>
|
|
||||||
/// TODO: Promote to DatItem level
|
|
||||||
[JsonObject("driver")]
|
|
||||||
public class Driver
|
|
||||||
{
|
|
||||||
[JsonProperty("status")]
|
|
||||||
public string Status { get; set; } // TODO: (good|imperfect|preliminary)
|
|
||||||
|
|
||||||
[JsonProperty("emulation")]
|
|
||||||
public string Emulation { get; set; } // TODO: (good|imperfect|preliminary)
|
|
||||||
|
|
||||||
[JsonProperty("cocktail")]
|
|
||||||
public string Cocktail { get; set; } // TODO: bool? (good|imperfect|preliminary)?
|
|
||||||
|
|
||||||
[JsonProperty("savestate")]
|
|
||||||
public string SaveState { get; set; } // TODO: (supported|unsupported)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents one ListXML extension
|
/// Represents one ListXML extension
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -482,6 +482,9 @@ namespace SabreTools.Library.DatItems
|
|||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
return new Disk();
|
return new Disk();
|
||||||
|
|
||||||
|
case ItemType.Driver:
|
||||||
|
return new Driver();
|
||||||
|
|
||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
return new Feature();
|
return new Feature();
|
||||||
|
|
||||||
@@ -524,6 +527,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
ItemType.DeviceReference => new DeviceReference(),
|
ItemType.DeviceReference => new DeviceReference(),
|
||||||
ItemType.DipSwitch => new DipSwitch(),
|
ItemType.DipSwitch => new DipSwitch(),
|
||||||
ItemType.Disk => new Disk(),
|
ItemType.Disk => new Disk(),
|
||||||
|
ItemType.Driver => new Driver(),
|
||||||
ItemType.Feature => new Feature(),
|
ItemType.Feature => new Feature(),
|
||||||
ItemType.Media => new Media(),
|
ItemType.Media => new Media(),
|
||||||
ItemType.RamOption => new RamOption(),
|
ItemType.RamOption => new RamOption(),
|
||||||
|
|||||||
248
SabreTools.Library/DatItems/Driver.cs
Normal file
248
SabreTools.Library/DatItems/Driver.cs
Normal file
@@ -0,0 +1,248 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
using SabreTools.Library.Filtering;
|
||||||
|
using SabreTools.Library.Tools;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
|
namespace SabreTools.Library.DatItems
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents the a driver of the machine
|
||||||
|
/// </summary>
|
||||||
|
[JsonObject("driver")]
|
||||||
|
public class Driver : DatItem
|
||||||
|
{
|
||||||
|
#region Fields
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overall driver status
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("status", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public SupportStatus Status { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Driver emulation status
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("emulation", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public SupportStatus Emulation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cocktail orientation status
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("cocktail", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public SupportStatus Cocktail { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save state support status
|
||||||
|
/// </summary>
|
||||||
|
[JsonProperty("savestate", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public Supported SaveState { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Accessors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set fields with given values
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mappings">Mappings dictionary</param>
|
||||||
|
public override void SetFields(Dictionary<Field, string> mappings)
|
||||||
|
{
|
||||||
|
// Set base fields
|
||||||
|
base.SetFields(mappings);
|
||||||
|
|
||||||
|
// Handle Feature-specific fields
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_SupportStatus))
|
||||||
|
Status = mappings[Field.DatItem_SupportStatus].AsSupportStatus();
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_EmulationStatus))
|
||||||
|
Emulation = mappings[Field.DatItem_EmulationStatus].AsSupportStatus();
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_CocktailStatus))
|
||||||
|
Cocktail = mappings[Field.DatItem_CocktailStatus].AsSupportStatus();
|
||||||
|
|
||||||
|
if (mappings.Keys.Contains(Field.DatItem_SaveStateStatus))
|
||||||
|
SaveState = mappings[Field.DatItem_SaveStateStatus].AsSupported();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a default, empty Driver object
|
||||||
|
/// </summary>
|
||||||
|
public Driver()
|
||||||
|
{
|
||||||
|
ItemType = ItemType.Driver;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Cloning Methods
|
||||||
|
|
||||||
|
public override object Clone()
|
||||||
|
{
|
||||||
|
return new Driver()
|
||||||
|
{
|
||||||
|
ItemType = this.ItemType,
|
||||||
|
DupeType = this.DupeType,
|
||||||
|
|
||||||
|
AltName = this.AltName,
|
||||||
|
AltTitle = this.AltTitle,
|
||||||
|
|
||||||
|
Original = this.Original,
|
||||||
|
OpenMSXSubType = this.OpenMSXSubType,
|
||||||
|
OpenMSXType = this.OpenMSXType,
|
||||||
|
Remark = this.Remark,
|
||||||
|
Boot = this.Boot,
|
||||||
|
|
||||||
|
Part = this.Part,
|
||||||
|
Features = this.Features,
|
||||||
|
AreaName = this.AreaName,
|
||||||
|
AreaSize = this.AreaSize,
|
||||||
|
AreaWidth = this.AreaWidth,
|
||||||
|
AreaEndianness = this.AreaEndianness,
|
||||||
|
Value = this.Value,
|
||||||
|
LoadFlag = this.LoadFlag,
|
||||||
|
|
||||||
|
Machine = this.Machine.Clone() as Machine,
|
||||||
|
Source = this.Source.Clone() as Source,
|
||||||
|
Remove = this.Remove,
|
||||||
|
|
||||||
|
Status = this.Status,
|
||||||
|
Emulation = this.Emulation,
|
||||||
|
Cocktail = this.Cocktail,
|
||||||
|
SaveState = this.SaveState,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Comparision Methods
|
||||||
|
|
||||||
|
public override bool Equals(DatItem other)
|
||||||
|
{
|
||||||
|
// If we don't have a Driver, return false
|
||||||
|
if (ItemType != other.ItemType)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Otherwise, treat it as a Driver
|
||||||
|
Driver newOther = other as Driver;
|
||||||
|
|
||||||
|
// If the Feature information matches
|
||||||
|
return (Status == newOther.Status
|
||||||
|
&& Emulation == newOther.Emulation
|
||||||
|
&& Cocktail == newOther.Cocktail
|
||||||
|
&& SaveState == newOther.SaveState);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Filtering
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check to see if a DatItem passes the filter
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filter">Filter to check against</param>
|
||||||
|
/// <returns>True if the item passed the filter, false otherwise</returns>
|
||||||
|
public override bool PassesFilter(Filter filter)
|
||||||
|
{
|
||||||
|
// Check common fields first
|
||||||
|
if (!base.PassesFilter(filter))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on status
|
||||||
|
if (filter.DatItem_SupportStatus.MatchesPositive(SupportStatus.NULL, Status) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_SupportStatus.MatchesNegative(SupportStatus.NULL, Status) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on emulation
|
||||||
|
if (filter.DatItem_EmulationStatus.MatchesPositive(SupportStatus.NULL, Emulation) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_EmulationStatus.MatchesNegative(SupportStatus.NULL, Emulation) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on cocktail
|
||||||
|
if (filter.DatItem_CocktailStatus.MatchesPositive(SupportStatus.NULL, Cocktail) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_CocktailStatus.MatchesNegative(SupportStatus.NULL, Cocktail) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Filter on savestate
|
||||||
|
if (filter.DatItem_SaveStateStatus.MatchesPositive(Supported.NULL, SaveState) == false)
|
||||||
|
return false;
|
||||||
|
if (filter.DatItem_SaveStateStatus.MatchesNegative(Supported.NULL, SaveState) == true)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove fields from the DatItem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fields">List of Fields to remove</param>
|
||||||
|
public override void RemoveFields(List<Field> fields)
|
||||||
|
{
|
||||||
|
// Remove common fields first
|
||||||
|
base.RemoveFields(fields);
|
||||||
|
|
||||||
|
// Remove the fields
|
||||||
|
if (fields.Contains(Field.DatItem_SupportStatus))
|
||||||
|
Status = SupportStatus.NULL;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_EmulationStatus))
|
||||||
|
Emulation = SupportStatus.NULL;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_CocktailStatus))
|
||||||
|
Cocktail = SupportStatus.NULL;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_SaveStateStatus))
|
||||||
|
SaveState = Supported.NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Sorting and Merging
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Replace fields from another item
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">DatItem to pull new information from</param>
|
||||||
|
/// <param name="fields">List of Fields representing what should be updated</param>
|
||||||
|
public override void ReplaceFields(DatItem item, List<Field> fields)
|
||||||
|
{
|
||||||
|
// Replace common fields first
|
||||||
|
base.ReplaceFields(item, fields);
|
||||||
|
|
||||||
|
// If we don't have a Driver to replace from, ignore specific fields
|
||||||
|
if (item.ItemType != ItemType.Driver)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Cast for easier access
|
||||||
|
Driver newItem = item as Driver;
|
||||||
|
|
||||||
|
// Replace the fields
|
||||||
|
if (fields.Contains(Field.DatItem_SupportStatus))
|
||||||
|
Status = newItem.Status;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_EmulationStatus))
|
||||||
|
Emulation = newItem.Emulation;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_CocktailStatus))
|
||||||
|
Cocktail = newItem.Cocktail;
|
||||||
|
|
||||||
|
if (fields.Contains(Field.DatItem_SaveStateStatus))
|
||||||
|
SaveState = newItem.SaveState;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -240,13 +240,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
Machine_Port_Analogs,
|
Machine_Port_Analogs,
|
||||||
Machine_Port_Analog_Mask,
|
Machine_Port_Analog_Mask,
|
||||||
|
|
||||||
// Drivers
|
|
||||||
Machine_Drivers,
|
|
||||||
Machine_Driver_Status,
|
|
||||||
Machine_Driver_Emulation,
|
|
||||||
Machine_Driver_Cocktail,
|
|
||||||
Machine_Driver_SaveState,
|
|
||||||
|
|
||||||
// Devices
|
// Devices
|
||||||
Machine_Devices,
|
Machine_Devices,
|
||||||
Machine_Device_Type,
|
Machine_Device_Type,
|
||||||
@@ -423,12 +416,18 @@ namespace SabreTools.Library.DatItems
|
|||||||
DatItem_Setting_Value,
|
DatItem_Setting_Value,
|
||||||
DatItem_Setting_Default,
|
DatItem_Setting_Default,
|
||||||
|
|
||||||
// DIP Switch.Values
|
// DipSwitch.Values
|
||||||
DatItem_Values,
|
DatItem_Values,
|
||||||
DatItem_Value_Name,
|
DatItem_Value_Name,
|
||||||
DatItem_Value_Value,
|
DatItem_Value_Value,
|
||||||
DatItem_Value_Default,
|
DatItem_Value_Default,
|
||||||
|
|
||||||
|
// Driver
|
||||||
|
DatItem_SupportStatus,
|
||||||
|
DatItem_EmulationStatus,
|
||||||
|
DatItem_CocktailStatus,
|
||||||
|
DatItem_SaveStateStatus,
|
||||||
|
|
||||||
// Feature
|
// Feature
|
||||||
DatItem_FeatureType,
|
DatItem_FeatureType,
|
||||||
DatItem_FeatureStatus,
|
DatItem_FeatureStatus,
|
||||||
@@ -496,6 +495,7 @@ namespace SabreTools.Library.DatItems
|
|||||||
Configuration,
|
Configuration,
|
||||||
DeviceReference,
|
DeviceReference,
|
||||||
DipSwitch,
|
DipSwitch,
|
||||||
|
Driver,
|
||||||
Feature,
|
Feature,
|
||||||
RamOption,
|
RamOption,
|
||||||
Release,
|
Release,
|
||||||
@@ -585,4 +585,20 @@ namespace SabreTools.Library.DatItems
|
|||||||
Partial = 1 << 1,
|
Partial = 1 << 1,
|
||||||
Yes = 1 << 2,
|
Yes = 1 << 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determine driver support statuses
|
||||||
|
/// </summary>
|
||||||
|
[Flags]
|
||||||
|
public enum SupportStatus
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This is a fake flag that is used for filter only
|
||||||
|
/// </summary>
|
||||||
|
NULL = 0,
|
||||||
|
|
||||||
|
Good = 1 << 0,
|
||||||
|
Imperfect = 1 << 1,
|
||||||
|
Preliminary = 1 << 2,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -176,12 +176,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
[JsonProperty("ports", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
[JsonProperty("ports", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||||
public List<Port> Ports { get; set; } = null;
|
public List<Port> Ports { get; set; } = null;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// List of associated drivers
|
|
||||||
/// </summary>
|
|
||||||
[JsonProperty("drivers", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
|
||||||
public List<Driver> Drivers { get; set; } = null;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// List of associated devices
|
/// List of associated devices
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -544,7 +538,6 @@ namespace SabreTools.Library.DatItems
|
|||||||
Conditions = this.Conditions,
|
Conditions = this.Conditions,
|
||||||
Inputs = this.Inputs,
|
Inputs = this.Inputs,
|
||||||
Ports = this.Ports,
|
Ports = this.Ports,
|
||||||
Drivers = this.Drivers,
|
|
||||||
Devices = this.Devices,
|
Devices = this.Devices,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -105,13 +105,6 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<bool?> Machine_Port_Analogs { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
public FilterItem<bool?> Machine_Port_Analogs { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
public FilterItem<string> Machine_Port_Analog_Mask { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> Machine_Port_Analog_Mask { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
// Drivers
|
|
||||||
public FilterItem<bool?> Machine_Drivers { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
|
||||||
public FilterItem<string> Machine_Driver_Status { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Driver_Emulation { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Driver_Cocktail { get; private set; } = new FilterItem<string>();
|
|
||||||
public FilterItem<string> Machine_Driver_SaveState { get; private set; } = new FilterItem<string>();
|
|
||||||
|
|
||||||
// Devices
|
// Devices
|
||||||
public FilterItem<bool?> Machine_Devices { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
public FilterItem<bool?> Machine_Devices { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
public FilterItem<string> Machine_Device_Type { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> Machine_Device_Type { get; private set; } = new FilterItem<string>();
|
||||||
@@ -294,12 +287,17 @@ namespace SabreTools.Library.Filtering
|
|||||||
public FilterItem<string> DatItem_Value_Value { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Value_Value { get; private set; } = new FilterItem<string>();
|
||||||
public FilterItem<bool?> DatItem_Value_Default { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
public FilterItem<bool?> DatItem_Value_Default { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||||
|
|
||||||
|
// Driver
|
||||||
|
public FilterItem<SupportStatus> DatItem_SupportStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = SupportStatus.NULL, Negative = SupportStatus.NULL };
|
||||||
|
public FilterItem<SupportStatus> DatItem_EmulationStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = SupportStatus.NULL, Negative = SupportStatus.NULL };
|
||||||
|
public FilterItem<SupportStatus> DatItem_CocktailStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = SupportStatus.NULL, Negative = SupportStatus.NULL };
|
||||||
|
public FilterItem<Supported> DatItem_SaveStateStatus { get; private set; } = new FilterItem<Supported>() { Positive = Supported.NULL, Negative = Supported.NULL };
|
||||||
|
|
||||||
// Feature
|
// Feature
|
||||||
public FilterItem<FeatureType> DatItem_FeatureType { get; private set; } = new FilterItem<FeatureType>() { Positive = FeatureType.NULL, Negative = FeatureType.NULL };
|
public FilterItem<FeatureType> DatItem_FeatureType { get; private set; } = new FilterItem<FeatureType>() { Positive = FeatureType.NULL, Negative = FeatureType.NULL };
|
||||||
public FilterItem<FeatureStatus> DatItem_FeatureStatus { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
|
public FilterItem<FeatureStatus> DatItem_FeatureStatus { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
|
||||||
public FilterItem<FeatureStatus> DatItem_FeatureOverall { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
|
public FilterItem<FeatureStatus> DatItem_FeatureOverall { get; private set; } = new FilterItem<FeatureStatus>() { Positive = FeatureStatus.NULL, Negative = FeatureStatus.NULL };
|
||||||
|
|
||||||
|
|
||||||
// Ram Option
|
// Ram Option
|
||||||
public FilterItem<string> DatItem_Content { get; private set; } = new FilterItem<string>();
|
public FilterItem<string> DatItem_Content { get; private set; } = new FilterItem<string>();
|
||||||
|
|
||||||
@@ -846,42 +844,6 @@ namespace SabreTools.Library.Filtering
|
|||||||
Machine_Port_Analog_Mask.PositiveSet.Add(value);
|
Machine_Port_Analog_Mask.PositiveSet.Add(value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Drivers
|
|
||||||
case Field.Machine_Drivers:
|
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
|
||||||
Machine_Drivers.Neutral = false;
|
|
||||||
else
|
|
||||||
Machine_Drivers.Neutral = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Driver_Status:
|
|
||||||
if (negate)
|
|
||||||
Machine_Driver_Status.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Driver_Status.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Driver_Emulation:
|
|
||||||
if (negate)
|
|
||||||
Machine_Driver_Emulation.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Driver_Emulation.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Driver_Cocktail:
|
|
||||||
if (negate)
|
|
||||||
Machine_Driver_Cocktail.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Driver_Cocktail.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Field.Machine_Driver_SaveState:
|
|
||||||
if (negate)
|
|
||||||
Machine_Driver_SaveState.NegativeSet.Add(value);
|
|
||||||
else
|
|
||||||
Machine_Driver_SaveState.PositiveSet.Add(value);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Devices
|
// Devices
|
||||||
case Field.Machine_Devices:
|
case Field.Machine_Devices:
|
||||||
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
if (negate || value.Equals("false", StringComparison.OrdinalIgnoreCase))
|
||||||
@@ -1697,6 +1659,35 @@ namespace SabreTools.Library.Filtering
|
|||||||
DatItem_Value_Default.Neutral = true;
|
DatItem_Value_Default.Neutral = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Driver
|
||||||
|
case Field.DatItem_SupportStatus:
|
||||||
|
if (negate)
|
||||||
|
DatItem_SupportStatus.Negative |= value.AsSupportStatus();
|
||||||
|
else
|
||||||
|
DatItem_SupportStatus.Positive |= value.AsSupportStatus();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_EmulationStatus:
|
||||||
|
if (negate)
|
||||||
|
DatItem_EmulationStatus.Negative |= value.AsSupportStatus();
|
||||||
|
else
|
||||||
|
DatItem_EmulationStatus.Positive |= value.AsSupportStatus();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_CocktailStatus:
|
||||||
|
if (negate)
|
||||||
|
DatItem_CocktailStatus.Negative |= value.AsSupportStatus();
|
||||||
|
else
|
||||||
|
DatItem_CocktailStatus.Positive |= value.AsSupportStatus();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Field.DatItem_SaveStateStatus:
|
||||||
|
if (negate)
|
||||||
|
DatItem_SaveStateStatus.Negative |= value.AsSupported();
|
||||||
|
else
|
||||||
|
DatItem_SaveStateStatus.Positive |= value.AsSupported();
|
||||||
|
break;
|
||||||
|
|
||||||
// Feature
|
// Feature
|
||||||
case Field.DatItem_FeatureType:
|
case Field.DatItem_FeatureType:
|
||||||
if (negate)
|
if (negate)
|
||||||
@@ -1789,9 +1780,9 @@ namespace SabreTools.Library.Filtering
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion // Item-Specifics
|
#endregion // Item-Specifics
|
||||||
|
|
||||||
#endregion // DatItem Filters
|
#endregion // DatItem Filters
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -698,21 +698,6 @@ namespace SabreTools.Library.Tools
|
|||||||
case "port_analog_mask":
|
case "port_analog_mask":
|
||||||
return Field.Machine_Port_Analog_Mask;
|
return Field.Machine_Port_Analog_Mask;
|
||||||
|
|
||||||
case "drivers":
|
|
||||||
return Field.Machine_Drivers;
|
|
||||||
|
|
||||||
case "driver_status":
|
|
||||||
return Field.Machine_Driver_Status;
|
|
||||||
|
|
||||||
case "driver_emulation":
|
|
||||||
return Field.Machine_Driver_Emulation;
|
|
||||||
|
|
||||||
case "driver_cocktail":
|
|
||||||
return Field.Machine_Driver_Cocktail;
|
|
||||||
|
|
||||||
case "driver_savestate":
|
|
||||||
return Field.Machine_Driver_SaveState;
|
|
||||||
|
|
||||||
case "devices":
|
case "devices":
|
||||||
return Field.Machine_Devices;
|
return Field.Machine_Devices;
|
||||||
|
|
||||||
@@ -1119,6 +1104,19 @@ namespace SabreTools.Library.Tools
|
|||||||
case "value_default":
|
case "value_default":
|
||||||
return Field.DatItem_Value_Default;
|
return Field.DatItem_Value_Default;
|
||||||
|
|
||||||
|
// Driver
|
||||||
|
case "supportstatus":
|
||||||
|
return Field.DatItem_SupportStatus;
|
||||||
|
|
||||||
|
case "emulationstatus":
|
||||||
|
return Field.DatItem_EmulationStatus;
|
||||||
|
|
||||||
|
case "cocktailstatus":
|
||||||
|
return Field.DatItem_CocktailStatus;
|
||||||
|
|
||||||
|
case "savestatestatus":
|
||||||
|
return Field.DatItem_SaveStateStatus;
|
||||||
|
|
||||||
// Feature
|
// Feature
|
||||||
case "featuretype":
|
case "featuretype":
|
||||||
return Field.DatItem_FeatureType;
|
return Field.DatItem_FeatureType;
|
||||||
@@ -1683,6 +1681,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return ItemType.DipSwitch;
|
return ItemType.DipSwitch;
|
||||||
case "disk":
|
case "disk":
|
||||||
return ItemType.Disk;
|
return ItemType.Disk;
|
||||||
|
case "driver":
|
||||||
|
return ItemType.Driver;
|
||||||
case "feature":
|
case "feature":
|
||||||
return ItemType.Feature;
|
return ItemType.Feature;
|
||||||
case "media":
|
case "media":
|
||||||
@@ -1716,6 +1716,7 @@ namespace SabreTools.Library.Tools
|
|||||||
"device_ref" => ItemType.DeviceReference,
|
"device_ref" => ItemType.DeviceReference,
|
||||||
"dipswitch" => ItemType.DipSwitch,
|
"dipswitch" => ItemType.DipSwitch,
|
||||||
"disk" => ItemType.Disk,
|
"disk" => ItemType.Disk,
|
||||||
|
"driver" => ItemType.Driver,
|
||||||
"feature" => ItemType.Feature,
|
"feature" => ItemType.Feature,
|
||||||
"media" => ItemType.Media,
|
"media" => ItemType.Media,
|
||||||
"ramoption" => ItemType.RamOption,
|
"ramoption" => ItemType.RamOption,
|
||||||
@@ -2015,10 +2016,12 @@ namespace SabreTools.Library.Tools
|
|||||||
switch (supported?.ToLowerInvariant())
|
switch (supported?.ToLowerInvariant())
|
||||||
{
|
{
|
||||||
case "no":
|
case "no":
|
||||||
|
case "unsupported":
|
||||||
return Supported.No;
|
return Supported.No;
|
||||||
case "partial":
|
case "partial":
|
||||||
return Supported.Partial;
|
return Supported.Partial;
|
||||||
case "yes":
|
case "yes":
|
||||||
|
case "supported":
|
||||||
return Supported.Yes;
|
return Supported.Yes;
|
||||||
default:
|
default:
|
||||||
return Supported.NULL;
|
return Supported.NULL;
|
||||||
@@ -2027,13 +2030,45 @@ namespace SabreTools.Library.Tools
|
|||||||
return supported?.ToLowerInvariant() switch
|
return supported?.ToLowerInvariant() switch
|
||||||
{
|
{
|
||||||
"no" => Supported.No,
|
"no" => Supported.No,
|
||||||
|
"unsupported" => Supported.No,
|
||||||
"partial" => Supported.Partial,
|
"partial" => Supported.Partial,
|
||||||
"yes" => Supported.Yes,
|
"yes" => Supported.Yes,
|
||||||
|
"supported" => Supported.Yes,
|
||||||
_ => Supported.NULL,
|
_ => Supported.NULL,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get SupportStatus value from input string
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="supported">String to get value from</param>
|
||||||
|
/// <returns>SupportStatus value corresponding to the string</returns>
|
||||||
|
public static SupportStatus AsSupportStatus(this string supportStatus)
|
||||||
|
{
|
||||||
|
#if NET_FRAMEWORK
|
||||||
|
switch (supportStatus?.ToLowerInvariant())
|
||||||
|
{
|
||||||
|
case "good":
|
||||||
|
return SupportStatus.Good;
|
||||||
|
case "imperfect":
|
||||||
|
return SupportStatus.Imperfect;
|
||||||
|
case "preliminary":
|
||||||
|
return SupportStatus.Preliminary;
|
||||||
|
default:
|
||||||
|
return SupportStatus.NULL;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
return supportStatus?.ToLowerInvariant() switch
|
||||||
|
{
|
||||||
|
"good" => SupportStatus.Good,
|
||||||
|
"imperfect" => SupportStatus.Imperfect,
|
||||||
|
"preliminary" => SupportStatus.Preliminary,
|
||||||
|
_ => SupportStatus.NULL,
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get bool? value from input string
|
/// Get bool? value from input string
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -2251,6 +2286,8 @@ namespace SabreTools.Library.Tools
|
|||||||
return "dipswitch";
|
return "dipswitch";
|
||||||
case ItemType.Disk:
|
case ItemType.Disk:
|
||||||
return "disk";
|
return "disk";
|
||||||
|
case ItemType.Driver:
|
||||||
|
return "driver";
|
||||||
case ItemType.Feature:
|
case ItemType.Feature:
|
||||||
return "feature";
|
return "feature";
|
||||||
case ItemType.Media:
|
case ItemType.Media:
|
||||||
@@ -2284,6 +2321,7 @@ namespace SabreTools.Library.Tools
|
|||||||
ItemType.DeviceReference => "device_ref",
|
ItemType.DeviceReference => "device_ref",
|
||||||
ItemType.DipSwitch => "dipswitch",
|
ItemType.DipSwitch => "dipswitch",
|
||||||
ItemType.Disk => "disk",
|
ItemType.Disk => "disk",
|
||||||
|
ItemType.Driver => "driver",
|
||||||
ItemType.Feature => "feature",
|
ItemType.Feature => "feature",
|
||||||
ItemType.Media => "media",
|
ItemType.Media => "media",
|
||||||
ItemType.RamOption => "ramoption",
|
ItemType.RamOption => "ramoption",
|
||||||
@@ -2611,18 +2649,19 @@ namespace SabreTools.Library.Tools
|
|||||||
/// Get string value from input Supported
|
/// Get string value from input Supported
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="supported">Supported to get value from</param>
|
/// <param name="supported">Supported to get value from</param>
|
||||||
|
/// <param name="verbose">True to use verbose output, false otherwise</param>
|
||||||
/// <returns>String value corresponding to the Supported</returns>
|
/// <returns>String value corresponding to the Supported</returns>
|
||||||
public static string FromSupported(this Supported supported)
|
public static string FromSupported(this Supported supported, bool verbose)
|
||||||
{
|
{
|
||||||
#if NET_FRAMEWORK
|
#if NET_FRAMEWORK
|
||||||
switch (supported)
|
switch (supported)
|
||||||
{
|
{
|
||||||
case Supported.No:
|
case Supported.No:
|
||||||
return "no";
|
return verbose ? "unsupported" : "no";
|
||||||
case Supported.Partial:
|
case Supported.Partial:
|
||||||
return "partial";
|
return "partial";
|
||||||
case Supported.Yes:
|
case Supported.Yes:
|
||||||
return "yes";
|
return verbose ? "supported" : "yes";
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -2637,6 +2676,36 @@ namespace SabreTools.Library.Tools
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get string value from input SupportStatus
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="supportStatus">SupportStatus to get value from</param>
|
||||||
|
/// <returns>String value corresponding to the SupportStatus</returns>
|
||||||
|
public static string FromSupportStatus(this SupportStatus supportStatus)
|
||||||
|
{
|
||||||
|
#if NET_FRAMEWORK
|
||||||
|
switch (supportStatus)
|
||||||
|
{
|
||||||
|
case SupportStatus.Good:
|
||||||
|
return "good";
|
||||||
|
case SupportStatus.Imperfect:
|
||||||
|
return "imperfect";
|
||||||
|
case SupportStatus.Preliminary:
|
||||||
|
return "preliminary";
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
return supportStatus switch
|
||||||
|
{
|
||||||
|
SupportStatus.Good => "good",
|
||||||
|
SupportStatus.Imperfect => "imperfect",
|
||||||
|
SupportStatus.Preliminary => "preliminary",
|
||||||
|
_ => null,
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get string value from input bool?
|
/// Get string value from input bool?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user