-
Notifications
You must be signed in to change notification settings - Fork 14
/
Agent.cs
378 lines (344 loc) · 8.19 KB
/
Agent.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
using EVE.ISXEVE.Extensions;
using InnerSpaceAPI;
using LavishScriptAPI;
namespace EVE.ISXEVE
{
/// <summary>
/// Wrapper for the agent data type.
/// </summary>
public class Agent : LavishScriptObject
{
#region Constructors
/// <summary>
/// Agent copy constructor.
/// </summary>
/// <param name="Obj"></param>
public Agent(LavishScriptObject Obj)
: base(Obj)
{
}
/// <summary>
/// Agent constructor by index.
/// </summary>
/// <param name="Index"></param>
public Agent(int Index)
: base(LavishScript.Objects.GetObject("Agent", Index.ToString(CultureInfo.CurrentCulture)))
{
}
/// <summary>
/// Agent constructor by ID.
/// </summary>
/// <param name="ByID">String param to differentiate. Pass empty string.</param>
/// <param name="ID"></param>
#pragma warning disable IDE0060 // Remove unused parameter
#pragma warning disable CA1801 // Review unused parameters
public Agent(string ByID, int ID)
#pragma warning restore CA1801 // Review unused parameters
#pragma warning restore IDE0060 // Remove unused parameter
: base(LavishScript.Objects.GetObject("Agent", "id", ID.ToString(CultureInfo.CurrentCulture)))
{
}
/// <summary>
/// Agent constructor by name.
/// </summary>
/// <param name="Name"></param>
public Agent(string Name)
: base(LavishScript.Objects.GetObject("Agent", Name))
{
}
#endregion
#region Factories
/// <summary>
/// Factory method for fetching an agent by index.
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public static Agent ByIndex(int index)
{
return new Agent(index);
}
/// <summary>
/// Factory method for fetching an agent by ID.
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public static Agent ById(int id)
{
return new Agent("", id);
}
/// <summary>
/// Factory method for fetching an agent by name.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public static Agent ByName(string name)
{
return new Agent(name);
}
#endregion
#region Enums
/// <summary>
/// Divisions of agents
/// </summary>
public enum AgentDivisions
{
None = 0,
Accounting,
Administration,
Advisory,
Archives,
Astrosurveying,
Command,
Financial = 8,
Intelligence,
InternalSecurity,
Legal,
Manufacturing,
Marketing,
Personnel = 15,
Production,
PublicRelations,
RD,
Storage = 20,
Surveillance,
Distribution,
Mining,
Security
}
/// <summary>
/// Types of agents
/// </summary>
public enum AgentTypes
{
None = 0,
Agent,
BasicAgent,
TutorialAgent,
ResearchAgent,
CONCORDAgent,
GenericStorylineMissionAgent,
StorylineMissionAgent,
EventMissionAgent,
FactionalWarfareAgent,
EpicArcAgent,
AuraAgent
}
#endregion
#region Members
private int? _id;
/// <summary>
/// Wrapper for the ID member of the agent type.
/// </summary>
public int ID
{
get
{
if (_id == null)
_id = this.GetInt("ID");
return _id.Value;
}
}
private string _name;
/// <summary>
/// Wrapper for the Name member of the agent type.
/// </summary>
public string Name
{
get { return _name ?? (_name = this.GetString("Name")); }
}
private int? _agentTypeId;
/// <summary>
/// Wrapper for the AgentTypeID member of the agent type.
/// </summary>
public int AgentTypeID
{
get
{
if (_agentTypeId == null)
_agentTypeId = this.GetInt("AgentTypeID");
return _agentTypeId.Value;
}
}
private string _division;
/// <summary>
/// Wrapper for the Division member of the agent type.
/// </summary>
public string Division
{
get { return _division ?? (_division = this.GetString("Division")); }
}
private int? _divisionId;
/// <summary>
/// Wrapper for the DivisionID member of the agent type.
/// </summary>
public int DivisionID
{
get
{
if (_divisionId == null)
_divisionId = this.GetInt("DivisionID");
return _divisionId.Value;
}
}
private int? _level;
/// <summary>
/// Wrapper for the Level member of the agent type.
/// </summary>
public int Level
{
get
{
if (_level == null)
_level = this.GetInt("Level");
return _level.Value;
}
}
private int? _corporationId;
/// <summary>
/// Wrapper for the CorporationID member of the agent type.
/// </summary>
public int CorporationID
{
get
{
if (_corporationId == null)
_corporationId = this.GetInt("CorporationID");
return _corporationId.Value;
}
}
private int? _factionId;
/// <summary>
/// Wrapper for the FactionID member of the agent type.
/// </summary>
public int FactionID
{
get
{
if (_factionId == null)
_factionId = this.GetInt("FactionID");
return _factionId.Value;
}
}
private string _gender;
/// <summary>
/// Wrapper for the Gender member of the agent datatype.
/// </summary>
public string Gender
{
get { return _gender ?? (_gender = this.GetString("Gender")); }
}
private float? _standingTo;
/// <summary>
/// Wrapper for the StandingTo member of the agent type.
/// </summary>
public float StandingTo
{
get
{
if (_standingTo == null)
_standingTo = this.GetFloat("StandingTo");
return _standingTo.Value;
}
}
private SolarSystem _solarsystem;
/// <summary>
/// Wrapper for the Solarsystem member of the agent type.
/// </summary>
public SolarSystem Solarsystem
{
get
{
return _solarsystem ?? (_solarsystem = new SolarSystem(GetMember("Solarsystem")));
}
}
private string _station;
/// <summary>
/// Wrapper for the Station member of the agent type.
/// </summary>
public string Station
{
get { return _station ?? (_station = this.GetString("Station")); }
}
private long? _stationId;
/// <summary>
/// Wrapper for the StationID member of the agent type.
/// </summary>
public long StationID
{
get
{
if (_stationId == null)
_stationId = this.GetInt64("StationID");
return _stationId.Value;
}
}
private int? _index;
/// <summary>
/// Wrapper for the Index member of the agent type.
/// </summary>
public int Index
{
get
{
if (_index == null)
_index = this.GetInt("Index");
return _index.Value;
}
}
private string _dialog;
/// <summary>
/// Wrapper for the Dialog member of the agent type.
/// </summary>
public string Dialog
{
get { return _dialog ?? (_dialog = this.GetString("Dialog")); }
}
private List<DialogString> _dialogResponses;
/// <summary>
/// Wrapper for the GetDialogResponses member of the agent type.
/// </summary>
/// <returns></returns>
public List<DialogString> GetDialogResponses()
{
Tracing.SendCallback("Agent:GetDialogResponses");
return _dialogResponses ?? (_dialogResponses = Util.GetListFromMethod<DialogString>(this, "GetDialogResponses", "dialogstring"));
}
private bool? _isLocatorAgent;
/// <summary>
/// Wrapper for the IsLocatorAgent member of the agent datatype.
/// </summary>
public bool IsLocatorAgent
{
get
{
if (_isLocatorAgent == null)
_isLocatorAgent = this.GetBool("IsLocatorAgent");
return _isLocatorAgent.Value;
}
}
private string _agentTypeName;
/// <summary>
/// Wrapper for the AgentTypeName member of the agent datatype.
/// </summary>
public string AgentTypeName
{
get { return _agentTypeName ?? (_agentTypeName = this.GetString("AgentTypeName")); }
}
#endregion
#region Methods
/// <summary>
/// Wrapper for the StartConversation method of the agent type.
/// </summary>
/// <returns></returns>
public bool StartConversation()
{
Tracing.SendCallback("Agent.StartConversation");
return ExecuteMethod("StartConversation");
}
#endregion
}
}