diff --git a/OpenDiablo2.Common/Enums/eHero.cs b/OpenDiablo2.Common/Enums/eHero.cs index c24b9885..e53f3fdf 100644 --- a/OpenDiablo2.Common/Enums/eHero.cs +++ b/OpenDiablo2.Common/Enums/eHero.cs @@ -33,15 +33,25 @@ namespace OpenDiablo2.Common.Enums public static class eHeroExtensions { + public readonly static eHero[] all = { + eHero.Barbarian, + eHero.Necromancer, + eHero.Paladin, + eHero.Assassin, + eHero.Sorceress, + eHero.Amazon, + eHero.Druid, + }; + public readonly static Dictionary tokens = new Dictionary { - { eHero.Amazon , "AM" }, - { eHero.Sorceress , "SO" }, + { eHero.Barbarian , "BA" }, { eHero.Necromancer , "NE" }, { eHero.Paladin , "PA" }, - { eHero.Barbarian , "BA" }, + { eHero.Assassin , "AI" }, + { eHero.Sorceress , "SO" }, + { eHero.Amazon , "AM" }, { eHero.Druid , "DZ" }, - { eHero.Assassin , "AI" } }; public static string ToToken(this eHero source) => tokens[source]; diff --git a/OpenDiablo2.Scenes/SelectHeroClass.cs b/OpenDiablo2.Scenes/SelectHeroClass.cs index fd68acb3..2de3fdd4 100644 --- a/OpenDiablo2.Scenes/SelectHeroClass.cs +++ b/OpenDiablo2.Scenes/SelectHeroClass.cs @@ -279,8 +279,7 @@ namespace OpenDiablo2.Scenes { StopSfx(); - var heros = Enum.GetValues(typeof(eHero)).Cast(); - foreach (var hero in heros) + foreach (var hero in eHeroExtensions.all) { heroRenderInfo[hero].SpecialFrameTime = 0; heroRenderInfo[hero].Stance = eHeroStance.Idle;