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:
@@ -728,74 +728,5 @@ namespace SabreTools.Library.DatFiles
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Static methods
|
||||
|
||||
/// <summary>
|
||||
/// Get the machine type from a string
|
||||
/// </summary>
|
||||
/// <param name="gametype">Machine type as a string</param>
|
||||
/// <returns>A machine type based on the input</returns>
|
||||
public static MachineType GetMachineTypeFromString(string gametype)
|
||||
{
|
||||
MachineType machineType = MachineType.NULL;
|
||||
switch (gametype.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
machineType |= MachineType.None;
|
||||
break;
|
||||
case "bios":
|
||||
machineType |= MachineType.Bios;
|
||||
break;
|
||||
case "dev":
|
||||
case "device":
|
||||
machineType |= MachineType.Device;
|
||||
break;
|
||||
case "mech":
|
||||
case "mechanical":
|
||||
machineType |= MachineType.Mechanical;
|
||||
break;
|
||||
default:
|
||||
Globals.Logger.Warning("{0} is not a valid type", gametype);
|
||||
break;
|
||||
}
|
||||
|
||||
return machineType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the item status from a string
|
||||
/// </summary>
|
||||
/// <param name="status">Item status as a string</param>
|
||||
/// <returns>An item status based on the input</returns>
|
||||
public static ItemStatus GetStatusFromString(string status)
|
||||
{
|
||||
ItemStatus itemStatus = ItemStatus.NULL;
|
||||
switch (status.ToLowerInvariant())
|
||||
{
|
||||
case "none":
|
||||
itemStatus |= ItemStatus.None;
|
||||
break;
|
||||
case "good":
|
||||
itemStatus |= ItemStatus.Good;
|
||||
break;
|
||||
case "baddump":
|
||||
itemStatus |= ItemStatus.BadDump;
|
||||
break;
|
||||
case "nodump":
|
||||
itemStatus |= ItemStatus.Nodump;
|
||||
break;
|
||||
case "verified":
|
||||
itemStatus |= ItemStatus.Verified;
|
||||
break;
|
||||
default:
|
||||
Globals.Logger.Warning("{0} is not a valid status", status);
|
||||
break;
|
||||
}
|
||||
|
||||
return itemStatus;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user