2022-11-01 18:01:28 +01:00
|
|
|
|
using EDPlayerJournal.Entries;
|
|
|
|
|
|
|
|
|
|
namespace EDPlayerJournal.BGS;
|
|
|
|
|
public class FactionKillBonds : Transaction {
|
2022-11-25 13:45:02 +01:00
|
|
|
|
public ulong TotalSum {
|
2022-11-01 18:01:28 +01:00
|
|
|
|
get {
|
2022-11-25 13:45:02 +01:00
|
|
|
|
return (ulong)Entries
|
2022-11-01 18:01:28 +01:00
|
|
|
|
.OfType<FactionKillBondEntry>()
|
2022-11-25 13:45:02 +01:00
|
|
|
|
.Sum(x => (decimal)x.Reward)
|
2022-11-01 18:01:28 +01:00
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string? VictimFaction {
|
|
|
|
|
get {
|
|
|
|
|
return Entries
|
|
|
|
|
.OfType<FactionKillBondEntry>()
|
|
|
|
|
.First()
|
|
|
|
|
.VictimFaction
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int CompareTo(Transaction? other) {
|
|
|
|
|
if (other == null || other.GetType() != typeof(FactionKillBonds)) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FactionKillBonds? b = other as FactionKillBonds;
|
|
|
|
|
if (b == null || b.VictimFaction == VictimFaction) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString() {
|
|
|
|
|
return string.Format("Faction Kill Bonds: {0} against {1}",
|
|
|
|
|
Credits.FormatCredits(TotalSum),
|
|
|
|
|
VictimFaction);
|
|
|
|
|
}
|
|
|
|
|
}
|