1
0
mirror of https://github.com/soarqin/DSP_Mods_TO.git synced 2025-12-14 02:23:32 +08:00

Added CruiseAssist and AutoPilot

This commit is contained in:
2023-12-20 22:06:59 +08:00
parent 6f224902f8
commit b693006e0a
41 changed files with 3956 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
using System;
namespace AutoPilot.Commons;
internal static class EnumUtils
{
public static bool TryParse<TEnum>(string value, out TEnum result) where TEnum : struct
{
if (value == null || !Enum.IsDefined(typeof(TEnum), value))
{
result = (TEnum)Enum.GetValues(typeof(TEnum)).GetValue(0);
return false;
}
result = (TEnum)Enum.Parse(typeof(TEnum), value);
return true;
}
}