-
Notifications
You must be signed in to change notification settings - Fork 0
/
BookMark.cs
322 lines (289 loc) · 6.82 KB
/
BookMark.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
using System;
using EVE.ISXEVE.Extensions;
using EVE.ISXEVE.Interfaces;
using LavishScriptAPI;
namespace EVE.ISXEVE
{
/// <summary>
/// Wrapper for the bookmark data type.
/// </summary>
public class BookMark : LavishScriptObject, IBookMark
{
#region Constructors
/// <summary>
/// BookMark object copy constructor
/// </summary>
/// <param name="Copy"></param>
public BookMark(LavishScriptObject Copy)
: base(Copy)
{
}
#endregion
#region Members
/// <summary>
/// Wrapper for the ID member of a bookmark object
/// </summary>
public Int64 ID
{
get
{
//Tracing.SendCallback("Bookmark.ID");
return this.GetInt64("ID");
}
}
/// <summary>
/// Wrapper for the Type member of a bookmark object
/// </summary>
public string Type
{
get { return this.GetString("Type"); }
}
/// <summary>
/// Wrapper for the TypeID member of a bookmark object
/// </summary>
public int TypeID
{
get { return this.GetInt("TypeID"); }
}
/// <summary>
/// Wrapper for the ToEntity.GroupID member of a bookmark object
/// </summary>
public int GroupID
{
get
{
Entity entity = new Entity(GetMember("ToEntity"));
if (!LavishScriptObject.IsNullOrInvalid(entity))
{
return entity.GroupID;
}
return -1;
}
}
/// <summary>
/// If the bookmark refers to an entity currently available on your
/// overhead, it will return said entity. Use LavishScriptObject.IsNullOrInvalid
/// to check for validity
/// </summary>
public Entity ToEntity
{
get
{
return new Entity(GetMember("ToEntity"));
}
}
/// <summary>
/// Wrapper for the SolarSystemID member of a bookmark object
/// </summary>
public int SolarSystemID
{
get { return this.GetInt("SolarSystemID"); }
}
/// <summary>
/// Wrapper for the X member of a bookmark object
/// </summary>
public double X
{
get { return this.GetDouble("X"); }
}
/// <summary>
/// Wrapper for the Y member of a bookmark object
/// </summary>
public double Y
{
get { return this.GetDouble("Y"); }
}
/// <summary>
/// Wrapper for the Z member of a bookmark object
/// </summary>
public double Z
{
get { return this.GetDouble("Z"); }
}
/// <summary>
/// Wrapper for the Label member of a bookmark object
/// </summary>
public string Label
{
get { return this.GetString("Label"); }
}
/// <summary>
/// Wrapper for the Note member of a bookmark object
/// </summary>
public string Note
{
get { return this.GetString("Note"); }
}
/// <summary>
/// Wrapper for the DateCreated member of a bookmark object
/// </summary>
public string DateCreated
{
get { return this.GetString("DateCreated"); }
}
/// <summary>
/// Wrapper for the TimeCreated member of a bookmark object
/// </summary>
public string TimeCreated
{
get { return this.GetString("TimeCreated"); }
}
/// <summary>
/// Wrapper for the AgentID member of a bookmark object
/// </summary>
public int AgentID
{
get { return this.GetInt("AgentID"); }
}
/// <summary>
/// Wrapper for the LocationID member of a bookmark object
/// </summary>
public Int64 LocationID
{
get
{
Tracing.SendCallback("Bookmark.LocationID");
return this.GetInt64("LocationID");
}
}
/// <summary>
/// Wrapper for the LocationNumber member of a bookmark object
/// </summary>
public int LocationNumber
{
get { return this.GetInt("LocationNumber"); }
}
/// <summary>
/// Wrapper for the LocationType member of a bookmark object
/// </summary>
public string LocationType
{
get { return this.GetString("LocationType"); }
}
/// <summary>
/// Wrapper for the ItemID member of a bookmark object
/// </summary>
public Int64 ItemID
{
get
{
Tracing.SendCallback("Bookmark.ItemID");
return this.GetInt64("ItemID");
}
}
/// <summary>
/// Wrapper for the CreatorID member of a bookmark object
/// </summary>
public Int64 CreatorID
{
get
{
Tracing.SendCallback("Bookmark.CreatorID");
return this.GetInt64("CreatorID");
}
}
/// <summary>
/// (NOTE: Only works for agent bookmarks.)
/// </summary>
public bool DeadSpace
{
get { return this.GetBool("DeadSpace"); }
}
/// <summary>
/// Wrapper for the OwnerID member of the 'bookmark' type.
/// </summary>
public long OwnerID
{
get
{
Tracing.SendCallback("BookMark.OwnerID");
return this.GetInt64("OwnerID");
}
}
private int? _jumpsTo;
public int JumpsTo
{
get
{
if (_jumpsTo == null)
_jumpsTo = this.GetInt("JumpsTo");
return _jumpsTo.Value;
}
}
#endregion
#region Methods
/// <summary>
/// This will only work with bookmarks for which there is an "AlignTo To" option available via the in-game UI.
/// </summary>
/// <returns></returns>
public bool AlignTo()
{
Tracing.SendCallback("BM.AlignTo", string.Empty);
return ExecuteMethod("AlignTo");
}
/// <summary>
/// Warp to 0 distance
/// </summary>
public bool WarpTo()
{
Tracing.SendCallback("BM.WarpTo");
return ExecuteMethod("WarpTo");
}
/// <summary>
/// Warp to the given distance
/// </summary>
public bool WarpTo(int Distance)
{
Tracing.SendCallback("BM.WarpTo", Distance.ToString());
return ExecuteMethod("WarpTo", Distance.ToString());
}
/// <summary>
/// Removes bookmark.
/// </summary>
public bool Remove()
{
Tracing.SendCallback("BM.Remove");
return ExecuteMethod("Remove");
}
/// <summary>
/// Sets bookmark as current destination.
/// </summary>
public bool SetDestination()
{
Tracing.SendCallback("BM.SetDestination");
return ExecuteMethod("SetDestination");
}
/// <summary>
/// Add bookmark to waypoint list.
/// </summary>
public bool AddWaypoint()
{
Tracing.SendCallback("BM.AddWaypoint");
return ExecuteMethod("AddWaypoint");
}
/// <summary>
/// Determine the # of jumps to the given solarsystem or station ID
/// </summary>
/// <param name="solarSystemOrStationId"></param>
/// <returns></returns>
public int GetJumpsTo(int solarSystemOrStationId)
{
return this.GetInt("JumpsTo", solarSystemOrStationId.ToString());
}
#endregion
}
public class Bookmark : BookMark
{
// Exists purely to give a BookMark-compatible class that is compatible with EveComFramework naming
#region Constructors
/// <summary>
/// Bookmark object copy constructor
/// </summary>
/// <param name="Copy"></param>
public Bookmark(LavishScriptObject Copy)
: base(Copy)
{
}
#endregion
}
}