43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using NonaBGS.Journal;
|
|||
|
using Newtonsoft.Json.Linq;
|
|||
|
|
|||
|
namespace NonaBGS.BGS {
|
|||
|
public class MissionCompleted : LogEntry {
|
|||
|
public MissionCompleted(MissionCompletedEntry e, string system, string station) {
|
|||
|
this.Entries.Add(e);
|
|||
|
this.Faction = e.JSON.GetValue("Faction").ToString();
|
|||
|
this.System = system;
|
|||
|
this.Station = station;
|
|||
|
}
|
|||
|
|
|||
|
public string MissionName {
|
|||
|
get { return (Entries[0] as MissionCompletedEntry).HumanReadableName; }
|
|||
|
}
|
|||
|
|
|||
|
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);
|
|||
|
|
|||
|
builder.AppendFormat("{0}", entry.HumanReadableName);
|
|||
|
if (influence != "") {
|
|||
|
builder.AppendFormat(", Influence: {0}", influence);
|
|||
|
}
|
|||
|
|
|||
|
return builder.ToString();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|