50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using System.Text;
|
|
using EDJournal;
|
|
|
|
namespace EliteBGS.BGS {
|
|
public class MissionCompleted : LogEntry {
|
|
public MissionCompleted(MissionCompletedEntry e) {
|
|
Entries.Add(e);
|
|
}
|
|
|
|
public string MissionName {
|
|
get {
|
|
MissionCompletedEntry c = Entries[0] as MissionCompletedEntry;
|
|
if (string.IsNullOrEmpty(c.HumanReadableName)) {
|
|
return c.Name;
|
|
} else {
|
|
return c.HumanReadableName;
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Influence {
|
|
get {
|
|
MissionCompletedEntry e = (Entries[0] as MissionCompletedEntry);
|
|
|
|
if (SystemAddress == 0) {
|
|
return e.GetInfluenceForFaction(Faction);
|
|
} else {
|
|
return e.GetInfluenceForFaction(Faction, SystemAddress);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override string ToString() {
|
|
if (Entries.Count <= 0) {
|
|
return "";
|
|
}
|
|
StringBuilder builder = new StringBuilder();
|
|
var entry = Entries[0] as MissionCompletedEntry;
|
|
var influence = entry.GetInfluenceForFaction(Faction, SystemAddress);
|
|
|
|
builder.AppendFormat("{0}", MissionName);
|
|
if (influence != "") {
|
|
builder.AppendFormat(", Influence: {0}", influence);
|
|
}
|
|
|
|
return builder.ToString();
|
|
}
|
|
}
|
|
}
|