-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathSolarSystem.cs
More file actions
114 lines (100 loc) · 3.59 KB
/
SolarSystem.cs
File metadata and controls
114 lines (100 loc) · 3.59 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
using System.Collections.Generic;
using EVE.ISXEVE.Extensions;
using LavishScriptAPI;
namespace EVE.ISXEVE
{
public class SolarSystem : Interstellar
{
public SolarSystem(LavishScriptObject copy) : base(copy)
{
}
private Region _region;
public Region Region
{
get { return _region ?? (_region = new Region(GetMember("Region"))); }
}
private Constellation _constellation;
public Constellation Constellation
{
get
{
return _constellation ?? (_constellation = new Constellation(GetMember("Constellation")));
}
}
private float? _security;
public float Security
{
get
{
if (_security == null)
_security = this.GetFloat("Security");
return _security.Value;
}
}
private int? _factionId;
public int FactionID
{
get
{
if (_factionId == null)
_factionId = this.GetInt("FactionID");
return _factionId.Value;
}
}
private string _faction;
public string Faction
{
get { return _faction ?? (_faction = this.GetString("Faction")); }
}
private int? _jumpsTo;
public int JumpsTo
{
get
{
if (_jumpsTo == null)
_jumpsTo = this.GetInt("JumpsTo");
return _jumpsTo.Value;
}
}
public bool AddWaypoint()
{
Tracing.SendCallback("Interstellar.AddWaypoint");
return ExecuteMethod("AddWaypoint");
}
public bool ClearWaypoint()
{
Tracing.SendCallback("Interstellar.ClearWaypoint");
return ExecuteMethod("ClearWaypoint");
}
public bool SetDestination()
{
Tracing.SendCallback("Interstellar.SetDestination");
return ExecuteMethod("SetDestination");
}
/// <summary>
/// Wrapper for the GetPlanetIDs method of the solarsystem datatype. Populates and returns a list of planet item IDs in this solar system.
/// </summary>
/// <returns></returns>
public List<int> GetPlanetIDs()
{
Tracing.SendCallback("SolarSystem.GetPlanetIDs");
return Util.GetListFromMethod<int>(this, "GetPlanetIDs", "int");
}
/// <summary>
/// Wrapper for the GetNumPlanetsByType method of the solarsystem datatype.
/// </summary>
/// <remarks>
/// The underlying LavishScript method populates a collection:int in-place, keyed by planet-type-name (string) with int counts.
/// The caller must pre-declare a variable of type "collection:int" and pass its name. Example:
/// <c>declare myPlanets collection:int</c> ...then... <c>${Universe[${Me.SolarSystemID}].GetNumPlanetsByType[myPlanets]}</c>
/// The C# wrapper cannot return the collection directly because Util has no collection-to-dict helper.
/// </remarks>
/// <param name="collectionLsVarName">Name of a pre-declared LavishScript collection:int variable to populate.</param>
/// <returns>True if the method succeeded.</returns>
public bool GetNumPlanetsByType(string collectionLsVarName)
{
Tracing.SendCallback("SolarSystem.GetNumPlanetsByType", collectionLsVarName);
return ExecuteMethod("GetNumPlanetsByType", collectionLsVarName);
}
}
}