-
Notifications
You must be signed in to change notification settings - Fork 14
/
Skill.cs
193 lines (169 loc) · 4.5 KB
/
Skill.cs
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
using System;
using System.Collections.Generic;
using System.Globalization;
using EVE.ISXEVE.Extensions;
using InnerSpaceAPI;
using LavishScriptAPI;
namespace EVE.ISXEVE
{
/// <summary>
/// Wrapper for the skill data type.
/// </summary>
public class Skill : LavishScriptObject
{
#region Constructors
/// <summary>
/// Skill object copy constructor.
/// </summary>
public Skill(LavishScriptObject Copy)
: base(Copy)
{
}
#endregion
#region Statics
/// <summary>
/// Get all skills our character knows.
/// </summary>
/// <returns></returns>
public static List<Skill> GetSkills()
{
Me me = new Me();
if (!LavishScriptObject.IsNullOrInvalid(me))
return new Me().GetSkills();
return new List<Skill>();
}
/// <summary>
/// Return a skill object based on the skill name parameter.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public static Skill GetSkill(string name)
{
Me me = new Me();
if (!LavishScriptObject.IsNullOrInvalid(me))
return new Me().Skill(name);
return new Skill(null);
}
/// <summary>
/// This just goes through all the skills looking for the skill
/// currently being trained. Check LavishScriptObject.IsNullOrInvalid
/// on the result.
/// </summary>
public static Skill SkillBeingTrained
{
get
{
Me me = new Me();
if (!LavishScriptObject.IsNullOrInvalid(me))
{
List<Skill> skills = GetSkills();
foreach (Skill skill in skills)
if (!LavishScriptObject.IsNullOrInvalid(skill) &&
skill.IsTraining)
return skill;
}
return new Skill(null);
}
}
#endregion
#region Members
/// <summary>
/// Wrapper for Name member of skill type.
/// </summary>
public string Name
{
get { return this.GetString("Name"); }
}
/// <summary>
/// Wrapper for ID member of skill type.
/// </summary>
public int ID
{
get { return this.GetInt("ID"); }
}
/// <summary>
/// Wrapper for Group member of skill type.
/// </summary>
public string Group
{
get { return this.GetString("Group"); }
}
/// <summary>
/// Wrapper for GroupID member of skill type.
/// </summary>
public int GroupID
{
get { return this.GetInt("GroupID"); }
}
/// <summary>
/// Wrapper for IsTraining member of skill type.
/// </summary>
public bool IsTraining
{
get { return this.GetBool("IsTraining"); }
}
/// <summary>
/// NOTE: This will be the time left to train this skill to the next level,
/// no matter if the skill is currently being trained or not. If the value
/// is ZERO, then the skill is maxed out.
/// ALSO! To get an accurate value for this, a skill must not be currently
/// training. So, if you need to know the time remaining on a skill that is
/// currently training, abort it first, then check this value.
/// </summary>
public double TimeToTrain
{
get { return this.GetDouble("TimeToTrain"); }
}
/// <summary>
/// Wrapper for TrainingTimeMultiplier member of skill type.
/// </summary>
public double TrainingTimeMultiplier
{
get { return this.GetDouble("TrainingTimeMultiplier"); }
}
/// <summary>
/// Wrapper for SkillPoints member of skill type.
/// </summary>
public int SkillPoints
{
get { return this.GetInt("SkillPoints"); }
}
/// <summary>
/// Wrapper for Level member of skill type.
/// </summary>
public int Level
{
get { return this.GetInt("Level"); }
}
#endregion
#region Methods
/// <summary>
/// Wrapper for AddToQueue method of the skill type.
/// </summary>
/// <returns></returns>
public bool AddToQueue(int skillLevel)
{
Tracing.SendCallback("Skill.AddtoQueue", skillLevel.ToString(CultureInfo.CurrentCulture));
return ExecuteMethod("AddToQueue", skillLevel.ToString(CultureInfo.CurrentCulture));
}
/// <summary>
/// Wrapper for AbortTraining method of the skill type.
/// </summary>
/// <returns></returns>
public bool AbortTraining()
{
Tracing.SendCallback("Skill.AbortTraining", string.Empty);
return ExecuteMethod("AbortTraining");
}
/// <summary>
/// Wrapper for StartTraining method of the skill type.
/// </summary>
/// <returns></returns>
public bool StartTraining()
{
Tracing.SendCallback("Skill.StartTraining", string.Empty);
return ExecuteMethod("StartTraining");
}
#endregion
}
}