Add a remaining ListXML-specific objects

Also fixes the usage of some other objects, adds proper objects for certain cases, and adds a bunch of TODOs around the new objects. There will be a lot of overhauls needed to properly support things like Devices and Slots
This commit is contained in:
Matt Nadareski
2020-08-23 15:34:42 -07:00
parent 90f55078d5
commit 2576e22c85
10 changed files with 649 additions and 180 deletions

View File

@@ -745,6 +745,36 @@ namespace SabreTools.Library.Tools
#endif
}
/// <summary>
/// Get Runnable value from input string
/// </summary>
/// <param name="runnable">String to get value from</param>
/// <returns>Runnable value corresponding to the string</returns>
public static Runnable AsRunnable(this string runnable)
{
#if NET_FRAMEWORK
switch (runnable?.ToLowerInvariant())
{
case "no":
return Runnable.No;
case "partial":
return Runnable.Partial;
case "yes":
return Runnable.Yes;
default:
return Runnable.NULL;
}
#else
return runnable?.ToLowerInvariant() switch
{
"no" => Runnable.No,
"partial" => Runnable.Partial,
"yes" => Runnable.Yes,
_ => Runnable.NULL,
};
#endif
}
/// <summary>
/// Get SplitType value from input ForceMerging
/// </summary>
@@ -849,7 +879,6 @@ namespace SabreTools.Library.Tools
#endif
}
/// <summary>
/// Get bool? value from input string
/// </summary>