-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimData.cs
More file actions
133 lines (123 loc) · 4.54 KB
/
Copy pathSimData.cs
File metadata and controls
133 lines (123 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using WoWSimsApp.Characters;
namespace WoWSimsApp
{
internal static class SimData
{
public struct ClassData
{
public readonly string Name;
public readonly Bitmap Icon;
public readonly List<string> Specs;
public readonly List<Bitmap> SpecIcons;
public ClassData( string name, Bitmap icon, List<string> specs, List<Bitmap> specIcons )
{
Name = name;
Icon = icon;
Specs = specs;
SpecIcons = specIcons;
}
}
public static Bitmap GetSpecIcon( string className, string specName )
{
var classData = Classes.Find( c => RemoveWhiteSpace( c.Name ).Equals( className, System.StringComparison.CurrentCultureIgnoreCase ) );
var foundSpec = classData.Specs.FindIndex( s => RemoveWhiteSpace( s ).Equals( specName, System.StringComparison.CurrentCultureIgnoreCase ) );
if (foundSpec > -1)
{
return classData.SpecIcons[foundSpec];
}
return null; // or a default icon if needed
}
public static string RemoveWhiteSpace( string input )
{
return new string( input.Where( c => !char.IsWhiteSpace( c ) ).ToArray() );
}
public static string CharacterToUrlCombo( SavedCharacter character )
{
var result = string.Empty;
result += character.Class switch
{
"deathknight" => "death_knight",
_ => character.Class,
};
result += "/";
result += character.Spec switch
{
"beastmastery" => "beast_mastery",
_ => character.Spec,
};
return result.ToLowerInvariant();
}
public static readonly List<ClassData> Classes = new List<ClassData>
{
new ClassData(
"Death Knight",
Properties.Resources.DeathKnight, // class icon
new List<string> { "Blood", "Frost", "Unholy" },
new List<Bitmap> { Properties.Resources.DeathKnightBlood, Properties.Resources.DeathKnightFrost, Properties.Resources.DeathKnightUnholy }
),
new ClassData(
"Druid",
Properties.Resources.Druid,
new List<string> { "Balance", "Feral", "Guardian", "Restoration" },
new List<Bitmap> { Properties.Resources.DruidBalance, Properties.Resources.DruidFeral, Properties.Resources.DruidGuardian, Properties.Resources.DruidRestoration }
),
new ClassData(
"Hunter",
Properties.Resources.Hunter,
new List<string> { "Beast Mastery", "Marksmanship", "Survival" },
new List<Bitmap> { Properties.Resources.HunterBeastMastery, Properties.Resources.HunterMarksmanship, Properties.Resources.HunterSurvival }
),
new ClassData(
"Mage",
Properties.Resources.Mage,
new List<string> { "Arcane", "Fire", "Frost" },
new List<Bitmap> { Properties.Resources.MageArcane, Properties.Resources.MageFire, Properties.Resources.MageFrost }
),
new ClassData(
"Monk",
Properties.Resources.Monk,
new List<string> { "Brewmaster", "Mistweaver", "Windwalker" },
new List<Bitmap> { Properties.Resources.MonkBrewmaster, Properties.Resources.MonkMistweaver, Properties.Resources.MonkWindwalker }
),
new ClassData(
"Paladin",
Properties.Resources.Paladin,
new List<string> { "Holy", "Protection", "Retribution" },
new List<Bitmap> { Properties.Resources.PaladinHoly, Properties.Resources.PaladinProtection, Properties.Resources.PaladinRetribution }
),
new ClassData(
"Priest",
Properties.Resources.Priest,
new List<string> { "Discipline", "Holy", "Shadow" },
new List<Bitmap> { Properties.Resources.PriestDiscipline, Properties.Resources.PriestHoly, Properties.Resources.PriestShadow }
),
new ClassData(
"Rogue",
Properties.Resources.Rogue,
new List<string> { "Assassination", "Combat", "Subtlety" },
new List<Bitmap> { Properties.Resources.RogueAssassination, Properties.Resources.RogueCombat, Properties.Resources.RogueSubtlety }
),
new ClassData(
"Shaman",
Properties.Resources.Shaman,
new List<string> { "Elemental", "Enhancement", "Restoration" },
new List<Bitmap> { Properties.Resources.ShamanElemental, Properties.Resources.ShamanEnhancement, Properties.Resources.ShamanRestoration }
),
new ClassData(
"Warlock",
Properties.Resources.Warlock,
new List<string> { "Affliction", "Demonology", "Destruction" },
new List<Bitmap> { Properties.Resources.WarlockAffliction, Properties.Resources.WarlockDemonology, Properties.Resources.WarlockDestruction }
),
new ClassData(
"Warrior",
Properties.Resources.Warrior,
new List<string> { "Arms", "Fury", "Protection" },
new List<Bitmap> { Properties.Resources.WarriorArms, Properties.Resources.WarriorFury, Properties.Resources.WarriorProtection }
)
};
}
}