EliteBGS/BGS/FactionKillBonds.cs

46 lines
1.1 KiB
C#
Raw Normal View History

using System.Linq;
using System.Globalization;
using EDJournal;
2021-11-10 21:24:39 +01:00
namespace EliteBGS.BGS {
public class FactionKillBonds : LogEntry {
public int TotalSum {
get {
return Entries
.OfType<FactionKillBondEntry>()
.Sum(x => x.Reward)
;
}
}
public string VictimFaction {
get {
return Entries
.OfType<FactionKillBondEntry>()
.First()
.VictimFaction
;
}
}
public override int CompareTo(LogEntry other) {
if (other.GetType() != typeof(FactionKillBonds)) {
return -1;
}
var b = other as FactionKillBonds;
if (b.VictimFaction == VictimFaction) {
return 0;
}
return -1;
}
public override string ToString() {
return string.Format("Faction Kill Bonds: {0} against {1}",
Credits.FormatCredits(TotalSum),
VictimFaction);
}
}
}