mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-16 21:09:22 +08:00
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using System;
|
|
|
|
namespace BetterGenshinImpact.GameTask.AutoGeniusInvokation.Model
|
|
{
|
|
public enum ActionEnum
|
|
{
|
|
ChooseFirst, SwitchLater, UseSkill
|
|
}
|
|
|
|
public static class ActionEnumExtension
|
|
{
|
|
public static ActionEnum ChineseToActionEnum(this string type)
|
|
{
|
|
type = type.ToLower();
|
|
return type switch
|
|
{
|
|
"出战" => /* ActionEnum.ChooseFirst, */ throw new ArgumentOutOfRangeException(nameof(type), type, null),
|
|
"切换" => /* ActionEnum.SwitchLater, */ throw new ArgumentOutOfRangeException(nameof(type), type, null),
|
|
"使用" => ActionEnum.UseSkill,
|
|
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
|
|
};
|
|
}
|
|
|
|
public static string ToChinese(this ActionEnum type)
|
|
{
|
|
return type switch
|
|
{
|
|
ActionEnum.ChooseFirst => "出战",
|
|
ActionEnum.SwitchLater => "切换",
|
|
ActionEnum.UseSkill => "使用",
|
|
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
|
|
};
|
|
}
|
|
}
|
|
}
|