2021-08-25 16:36:57 +02:00
|
|
|
|
using System.Text;
|
|
|
|
|
using EDJournal;
|
2021-07-09 11:03:30 +02:00
|
|
|
|
|
2021-11-10 21:24:39 +01:00
|
|
|
|
namespace EliteBGS.BGS {
|
2021-07-09 11:03:30 +02:00
|
|
|
|
public class MissionCompleted : LogEntry {
|
2021-11-12 22:23:40 +01:00
|
|
|
|
public MissionCompleted(MissionCompletedEntry e) {
|
|
|
|
|
Entries.Add(e);
|
|
|
|
|
Faction = e.JSON.GetValue("Faction").ToString();
|
2021-07-09 11:03:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string MissionName {
|
2021-11-16 18:44:02 +01:00
|
|
|
|
get {
|
|
|
|
|
MissionCompletedEntry c = Entries[0] as MissionCompletedEntry;
|
|
|
|
|
if (string.IsNullOrEmpty(c.HumanReadableName)) {
|
|
|
|
|
return c.Name;
|
|
|
|
|
} else {
|
|
|
|
|
return c.HumanReadableName;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-09 11:03:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Influence {
|
|
|
|
|
get { return (Entries[0] as MissionCompletedEntry).GetInfluenceForFaction(Faction); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString() {
|
|
|
|
|
if (Entries.Count <= 0) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
StringBuilder builder = new StringBuilder();
|
|
|
|
|
var entry = Entries[0] as MissionCompletedEntry;
|
|
|
|
|
var influence = entry.GetInfluenceForFaction(Faction);
|
|
|
|
|
|
2021-11-16 18:44:02 +01:00
|
|
|
|
builder.AppendFormat("{0}", MissionName);
|
2021-07-09 11:03:30 +02:00
|
|
|
|
if (influence != "") {
|
|
|
|
|
builder.AppendFormat(", Influence: {0}", influence);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return builder.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|