include failed missions in mission format

Since we now have to calculate negative INF with the normal INF (in case both happens), mission formatter now also handles failed missions.
This commit is contained in:
2023-09-08 11:43:05 +02:00
parent c43c6f742a
commit 4c75515a70
4 changed files with 92 additions and 65 deletions

View File

@@ -13,6 +13,21 @@ public class MissionFailed : Transaction {
Failed = failed;
}
/// <summary>
/// Returns the amount of influence generated by failing this mission. The
/// system returns no influence for one INF missions, but sadly also for
/// when the influence had no affect at all (i.e. during a war).
/// </summary>
public long InfluenceAmount {
get {
if (Mission == null || string.IsNullOrEmpty(Mission.Influence)) {
return -1;
} else {
return Mission.Influence.Length * -1;
}
}
}
public override int CompareTo(Transaction? other) {
if (other == null || other.GetType() != typeof(MissionFailed)) {
return -1;