forked from blakehartley/RNGHelper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpell.cs
More file actions
63 lines (57 loc) · 1.37 KB
/
Spell.cs
File metadata and controls
63 lines (57 loc) · 1.37 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace FF12RNGHelper
{
/// <summary>
/// Encapsulates a single cure spell
/// </summary>
class Spell
{
private string Name;
private Spells spell;
private int Power;
public Spell(ComboBox spell)
{
initialize(spell.SelectedItem.ToString());
}
private void initialize(string name)
{
Name = name;
spell = (Spells)Enum.Parse(typeof(Spells),
name.Replace(" ", "").TrimEnd(new char[] { '/', 'Z', 'A' }));
Power = spell.getSpellPower();
}
public int getPower()
{
return Power;
}
}
/// <summary>
/// A class encapsulating all possible cure spells
/// and their potencies
/// </summary>
enum Spells : int
{
Cure = 20,
Cura = 45,
Curaga = 85,
Curaja = 145,
CuraIZJS = 46,
CuragaIZJS = 86,
CurajaIZJS = 120
}
/// <summary>
/// Extension methods for the spells enum.
/// Allows the caller to cleanly get the spellpower.
/// </summary>
static class SpellsMethods
{
public static int getSpellPower(this Spells spell)
{
return (int)spell;
}
}
}