ground combat zones don't have objectives

This commit is contained in:
Florian Stinglmayr 2022-11-28 20:08:04 +01:00
parent 800ac73331
commit 91bca70168

View File

@ -43,6 +43,9 @@ public class CombatZone : Transaction {
/// </summary> /// </summary>
public int OptionalObjectivesCompleted { public int OptionalObjectivesCompleted {
get { get {
if (IsGround) {
return 0;
}
return new List<bool?>() { SpecOps, Captain, Correspondent, CapitalShip } return new List<bool?>() { SpecOps, Captain, Correspondent, CapitalShip }
.Where(x => x != null && x == true) .Where(x => x != null && x == true)
.Count() .Count()
@ -50,6 +53,20 @@ public class CombatZone : Transaction {
} }
} }
/// <summary>
/// Returns true if it is an on foot/ground combat zone
/// </summary>
public bool IsGround {
get { return string.Compare(Type, "On Foot") == 0; }
}
/// <summary>
/// Returns true if it is an on foot combat zone
/// </summary>
public bool IsShip {
get { return string.Compare(Type, "Ship") == 0; }
}
public override int CompareTo(Transaction? obj) { public override int CompareTo(Transaction? obj) {
if (obj == null || obj.GetType() != typeof(CombatZone)) { if (obj == null || obj.GetType() != typeof(CombatZone)) {
return -1; return -1;