diff --git a/EVEData/System.cs b/EVEData/System.cs index c567cd6e..9b2cfc83 100644 --- a/EVEData/System.cs +++ b/EVEData/System.cs @@ -12,18 +12,6 @@ namespace SMT.EVEData /// public class System { - /// - /// Initializes a new instance of the class. - /// - public System() - { - Jumps = new List(); - SHStructures = new List(); - - SOVAllianceID = 0; - HasJumpBeacon = false; - } - /// /// Initializes a new instance of the class. /// @@ -31,6 +19,7 @@ public System() /// ID of the system /// Region this system is in /// Does this system contain an NPC station + /// Does this system has an ice belt public System(string name, long id, string region, bool station, bool iceBelt) { Name = name; @@ -38,19 +27,6 @@ public System(string name, long id, string region, bool station, bool iceBelt) Region = region; HasNPCStation = station; HasIceBelt = iceBelt; - - // default the ESI stats - NPCKillsLastHour = 0; - NPCKillsDeltaLastHour = 0; - PodKillsLastHour = 0; - ShipKillsLastHour = 0; - JumpsLastHour = 0; - ActiveIncursion = false; - - SOVAllianceID = 0; - - Jumps = new List(); - SHStructures = new List(); } public enum EdenComTrigStatus @@ -67,7 +43,7 @@ public enum EdenComTrigStatus /// Gets or sets the an incursion is active in this system /// [XmlIgnoreAttribute] - public bool ActiveIncursion { get; set; } + public bool ActiveIncursion { get; set; } = false; /// /// Gets or sets the X coordinate in real space for this system @@ -120,7 +96,7 @@ public enum EdenComTrigStatus public bool FactionWarSystem { get; set; } [XmlIgnoreAttribute] - public bool HasJumpBeacon { get; set; } + public bool HasJumpBeacon { get; set; } = false; /// /// Gets or sets if this system has an NPC Station @@ -144,13 +120,13 @@ public enum EdenComTrigStatus /// /// Gets or sets the list of Jumps from this system /// - public List Jumps { get; set; } + public List Jumps { get; set; } = new(); /// /// Gets or sets the number of pods killed in the last hour /// [XmlIgnoreAttribute] - public int JumpsLastHour { get; set; } + public int JumpsLastHour { get; set; } = 0; /// /// Gets or sets the Name of the system @@ -161,13 +137,13 @@ public enum EdenComTrigStatus /// Gets or sets the delta of NPC Kills in the last hour /// [XmlIgnoreAttribute] - public int NPCKillsDeltaLastHour { get; set; } + public int NPCKillsDeltaLastHour { get; set; } = 0; /// /// Gets or sets the number of NPC Kills in the last hour /// [XmlIgnoreAttribute] - public int NPCKillsLastHour { get; set; } + public int NPCKillsLastHour { get; set; } = 0; /// /// Gets or sets the Faction of the system if owned by an NPC Corp @@ -179,7 +155,7 @@ public enum EdenComTrigStatus /// Gets or sets the number of pod kills in the last hour /// [XmlIgnoreAttribute] - public int PodKillsLastHour { get; set; } + public int PodKillsLastHour { get; set; } = 0; public double RadiusAU { get; set; } @@ -192,19 +168,19 @@ public enum EdenComTrigStatus /// Gets or sets the number of player ships killed in the last hour /// [XmlIgnoreAttribute] - public int ShipKillsLastHour { get; set; } + public int ShipKillsLastHour { get; set; } = 0; /// /// Gets or sets the an incursion is active in this system /// [XmlIgnoreAttribute] - public List SHStructures { get; set; } + public List SHStructures { get; set; } = new(); /// /// Gets or sets the name of the alliance holding sov in this system /// [XmlIgnoreAttribute] - public int SOVAllianceID { get; set; } + public int SOVAllianceID { get; set; } = 0; /// /// Gets or sets the name of the corporation holding sov in this system @@ -226,27 +202,12 @@ public enum EdenComTrigStatus /// public double TrueSec { get; set; } - public string SecType - { - get - { - if (TrueSec >= 0.45) - { - return "High Sec"; - } - - if (TrueSec > 0.0 && TrueSec < 0.45) - { - return "Low Sec"; - } - - return "Null Sec"; - } - } + public string SecType => String.Join((TrueSec switch { + >= 0.45 => "High", + > 0.0 and < 0.45 => "Low", + _ => "Null" + }), " Sec"); - public override string ToString() - { - return $"{Name} ({Region})"; - } + public override string ToString() => $"{Name} ({Region})"; } -} \ No newline at end of file +}