store optional events in combat zone
This commit is contained in:
parent
65fec2cd1e
commit
dd1d7ff091
@ -3,9 +3,52 @@ using System.Linq;
|
||||
|
||||
namespace EDPlayerJournal.BGS;
|
||||
public class CombatZone : Transaction {
|
||||
public string Type { get; set; } = "";
|
||||
public string Grade { get; set; } = "";
|
||||
public int Amount { get; set; } = 0;
|
||||
/// <summary>
|
||||
/// Type, either on foot or ship
|
||||
/// </summary>
|
||||
public string Type { get; set; } = "Ship";
|
||||
|
||||
/// <summary>
|
||||
/// Difficulty type, low, medium or high.
|
||||
/// </summary>
|
||||
public string Grade { get; set; } = "Low";
|
||||
|
||||
/// <summary>
|
||||
/// How many?
|
||||
/// </summary>
|
||||
public int Amount { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Whether spec ops were won.
|
||||
/// </summary>
|
||||
public bool? SpecOps { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether captain was won
|
||||
/// </summary>
|
||||
public bool? Captain { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether correspondent objective was won
|
||||
/// </summary>
|
||||
public bool? Correspondent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether cap ship objective was won
|
||||
/// </summary>
|
||||
public bool? CapitalShip { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// How many optional objectives were completed?
|
||||
/// </summary>
|
||||
public int OptionalObjectivesCompleted {
|
||||
get {
|
||||
return new List<bool?>() { SpecOps, Captain, Correspondent, CapitalShip }
|
||||
.Where(x => x != null && x == true)
|
||||
.Count()
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
public override int CompareTo(Transaction? obj) {
|
||||
if (obj == null || obj.GetType() != typeof(CombatZone)) {
|
||||
|
@ -106,6 +106,11 @@ internal class TransactionParserContext {
|
||||
Faction = LastRecordedAwardingFaction,
|
||||
Grade = grade,
|
||||
Type = cztype,
|
||||
// Sad truth is, if HaveSeenXXX is false, we just don't know for certain
|
||||
CapitalShip = HaveSeenCapShip ? true : null,
|
||||
SpecOps = HaveSeenSpecOps ? true : null,
|
||||
Correspondent = HaveSeenCorrespondent ? true : null,
|
||||
Captain = HaveSeenCaptain ? true : null,
|
||||
Amount = 1,
|
||||
};
|
||||
zone.Entries.Add(e);
|
||||
|
Loading…
Reference in New Issue
Block a user