mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SabreTools, Filter, Utilties] Move helper methods to Utilities
This commit is contained in:
@@ -362,6 +362,52 @@ namespace SabreTools.Library.Tools
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get MachineType value from input string
|
||||
/// </summary>
|
||||
/// <param name="gametype">String to get value from</param>
|
||||
/// <returns>MachineType value corresponding to the string</returns>
|
||||
public static MachineType GetMachineType(string gametype)
|
||||
{
|
||||
switch (gametype?.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
default:
|
||||
return MachineType.None;
|
||||
case "bios":
|
||||
return MachineType.Bios;
|
||||
case "dev":
|
||||
case "device":
|
||||
return MachineType.Device;
|
||||
case "mech":
|
||||
case "mechanical":
|
||||
return MachineType.Mechanical;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get ItemStatus value from input string
|
||||
/// </summary>
|
||||
/// <param name="status">String to get value from</param>
|
||||
/// <returns>ItemStatus value corresponding to the string</returns>
|
||||
public static ItemStatus GetItemStatus(string status)
|
||||
{
|
||||
switch (status?.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
default:
|
||||
return ItemStatus.None;
|
||||
case "good":
|
||||
return ItemStatus.Good;
|
||||
case "baddump":
|
||||
return ItemStatus.BadDump;
|
||||
case "nodump":
|
||||
return ItemStatus.Nodump;
|
||||
case "verified":
|
||||
return ItemStatus.Verified;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replace accented characters
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user