EDBGS/EDPlayerJournal/CombatZones.cs

65 lines
1.7 KiB
C#
Raw Permalink Normal View History

namespace EDPlayerJournal;
/// <summary>
/// Static strings related to combat zones
/// </summary>
public class CombatZones {
/// <summary>
/// Type string for ground combat zone
/// </summary>
public static readonly string GroundCombatZone = "Ground";
/// <summary>
/// Type string for ship combat zones
/// </summary>
public static readonly string ShipCombatZone = "Ship";
/// <summary>
/// AX combat zone
/// </summary>
public static readonly string AXCombatZone = "AX";
/// <summary>
/// Difficulty low
/// </summary>
public static readonly string DifficultyLow = "Low";
/// <summary>
/// Difficulty medium
/// </summary>
public static readonly string DifficultyMedium = "Medium";
/// <summary>
/// Difficulty high
/// </summary>
public static readonly string DifficultyHigh = "High";
/// <summary>
/// Very high difficulty, so far AX combat zone only
/// </summary>
public static readonly string DifficultyVeryHigh = "Very High";
2023-02-25 17:48:01 +01:00
/// <summary>
/// Returns the given combat zone difficulty as an integer, so it can be sorted.
/// 0 = lowest difficulty, 1 = medium and so forth.
/// </summary>
2023-02-26 21:57:24 +01:00
public static int? DifficultyRank(string? difficulty) {
2023-02-25 17:48:01 +01:00
Dictionary<string, int> ranks = new() {
{ DifficultyLow, 0 },
{ DifficultyMedium, 1 },
{ DifficultyHigh, 2 },
{ DifficultyVeryHigh, 3 }
};
2023-02-26 21:57:24 +01:00
if (difficulty == null ) {
return null;
}
2023-02-25 17:48:01 +01:00
if (ranks.TryGetValue(difficulty, out int rank)) {
return rank;
}
return null;
}
}