EDBGS/EDPlayerJournal/BGS/InfluenceSupport.cs
Florian Stinglmayr c43c6f742a introduce negative influence
Sometimes missions actually tell us how much negative influence a faction got through secondary influences. We now count this, and present is as negative influence via minuses. Summaries have been updated to reflect this change.
2023-09-08 11:20:49 +02:00

55 lines
1.5 KiB
C#

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 {
public MissionInfluence? Influence { get; set; } = null;
/// <summary>
/// Relevant mission completed entry
/// </summary>
public MissionCompletedEntry? RelevantMission { get; set; }
/// <summary>
/// Mission information
/// </summary>
public Mission? Mission { get; set; }
public override DateTime? CompletedAtDateTime {
get {
if (RelevantMission == null) {
return null;
}
return RelevantMission.Timestamp;
}
}
public override string ToString() {
StringBuilder builder = new StringBuilder();
string? missionname;
if (RelevantMission != null && RelevantMission.Mission != null) {
missionname = RelevantMission.Mission.FriendlyName;
} else {
missionname = "UNKNOWN MISSION";
}
if (missionname == null) {
return "";
}
builder.AppendFormat("Influence gained from \"{0}\": \"{1}\"",
missionname,
Influence == null ? "NONE" : Influence.TrendAdjustedInfluence
);
return builder.ToString();
}
}