1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-10-16 07:03:52 -04:00
OpenDiablo2/OpenDiablo2.Common/Enums/eHero.cs

37 lines
976 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenDiablo2.Common.Enums
{
public enum eHero
{
Barbarian,
Necromancer,
Paladin,
Assassin,
Sorceress,
Amazon,
Druid
}
public static class eHeroExtensions
{
public readonly static Dictionary<eHero, string> tokens = new Dictionary<eHero, string>
{
{ eHero.Amazon , "AM" },
{ eHero.Sorceress , "SO" },
{ eHero.Necromancer , "NE" },
{ eHero.Paladin , "PA" },
{ eHero.Barbarian , "BA" },
{ eHero.Druid , "DZ" },
{ eHero.Assassin , "AI" }
};
public static string ToToken(this eHero source) => tokens[source];
public static eHero ToHero(this string source) => tokens.First(x => x.Value.ToUpper() == source.ToUpper()).Key;
}
}