From b19a576515b554134539a05962134df78e500a1c Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Wed, 10 May 2023 09:36:02 +0200 Subject: [PATCH] add internal names for combat zones --- EDPlayerJournal/Instances.cs | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 EDPlayerJournal/Instances.cs diff --git a/EDPlayerJournal/Instances.cs b/EDPlayerJournal/Instances.cs new file mode 100644 index 0000000..55f88c9 --- /dev/null +++ b/EDPlayerJournal/Instances.cs @@ -0,0 +1,52 @@ +namespace EDPlayerJournal; + +/// +/// Contains information regarding instances you can supercruise into, +/// such as combat zones, installations and megaship scenarios. +/// +public class Instances { + /// + /// Low ship combat zone + /// + public static readonly string WarzoneLow = "$Warzone_PointRace_Low"; + /// + /// Medium ship combat zone + /// + public static readonly string WarzoneMedium = "$Warzone_PointRace_Med"; + /// + /// High ship combat zone. + /// + public static readonly string WarzoneHigh = "$Warzone_PointRace_High"; + + /// + /// Low Thargoid combat zone + /// + public static readonly string WarzoneThargoidLow = "$Warzone_TG_Low"; + /// + /// Medium Thargoid combat zone + /// + public static readonly string WarzoneThargoidMed = "$Warzone_TG_Med"; + /// + /// High Thargoid combat zone + /// + public static readonly string WarzoneThargoidHigh = "$Warzone_TG_High"; + /// + /// Very High Thargoid combat zone + /// + public static readonly string WarzoneThargoidVeryHigh = "$Warzone_TG_VeryHigh"; + + public static bool IsInstance(string type, string instance) { + if (string.IsNullOrEmpty(type) || string.IsNullOrEmpty(instance)) { + return false; + } + + // Instance names are split by a semi colon, with the remainder being + // additional info to such as index. + string[] parts = type.Split(":"); + if (!parts[0].StartsWith("$")) { + return false; + } + + return string.Compare(parts[0], instance, true) == 0; + } +}