2022-11-01 18:01:28 +01:00
|
|
|
|
using System.Text;
|
|
|
|
|
using EDPlayerJournal.Entries;
|
|
|
|
|
|
|
|
|
|
namespace EDPlayerJournal.BGS;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This class is used when a completed mission gives influence to another
|
|
|
|
|
/// faction as well. This happens, for example, when you deliver cargo from one
|
|
|
|
|
/// faction to another. Both sometimes gain influence.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class InfluenceSupport : Transaction {
|
2023-09-08 11:20:49 +02:00
|
|
|
|
public MissionInfluence? Influence { get; set; } = null;
|
2022-12-03 14:16:45 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Relevant mission completed entry
|
|
|
|
|
/// </summary>
|
2022-11-01 18:01:28 +01:00
|
|
|
|
public MissionCompletedEntry? RelevantMission { get; set; }
|
|
|
|
|
|
2022-12-03 14:16:45 +01:00
|
|
|
|
/// <summary>
|
2022-12-20 18:33:09 +01:00
|
|
|
|
/// Mission information
|
2022-12-03 14:16:45 +01:00
|
|
|
|
/// </summary>
|
2022-12-20 18:33:09 +01:00
|
|
|
|
public Mission? Mission { get; set; }
|
2022-12-03 14:16:45 +01:00
|
|
|
|
|
2022-12-09 17:51:46 +01:00
|
|
|
|
public override DateTime? CompletedAtDateTime {
|
2022-11-01 18:01:28 +01:00
|
|
|
|
get {
|
|
|
|
|
if (RelevantMission == null) {
|
2022-12-09 17:51:46 +01:00
|
|
|
|
return null;
|
2022-11-01 18:01:28 +01:00
|
|
|
|
}
|
2022-12-09 17:51:46 +01:00
|
|
|
|
return RelevantMission.Timestamp;
|
2022-11-01 18:01:28 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString() {
|
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
|
string? missionname;
|
|
|
|
|
|
2022-11-24 15:53:40 +01:00
|
|
|
|
if (RelevantMission != null && RelevantMission.Mission != null) {
|
2022-11-26 17:32:08 +01:00
|
|
|
|
missionname = RelevantMission.Mission.FriendlyName;
|
2022-11-01 18:01:28 +01:00
|
|
|
|
} else {
|
|
|
|
|
missionname = "UNKNOWN MISSION";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (missionname == null) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
builder.AppendFormat("Influence gained from \"{0}\": \"{1}\"",
|
|
|
|
|
missionname,
|
2023-09-08 11:20:49 +02:00
|
|
|
|
Influence == null ? "NONE" : Influence.TrendAdjustedInfluence
|
2022-11-01 18:01:28 +01:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return builder.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|