diff --git a/BGS/FactionKillBonds.cs b/BGS/FactionKillBonds.cs new file mode 100644 index 0000000..89b5143 --- /dev/null +++ b/BGS/FactionKillBonds.cs @@ -0,0 +1,43 @@ +using System.Linq; +using System.Globalization; +using EDJournal; + +namespace NonaBGS.BGS { + public class FactionKillBonds : LogEntry { + public int TotalSum { + get { + return Entries + .OfType() + .Sum(x => x.Reward) + ; + } + } + + public string VictimFaction { + get { + return Entries + .OfType() + .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}", Credits.FormatCredits(TotalSum)); + } + } +} diff --git a/BGS/Report.cs b/BGS/Report.cs index 3e7fe6e..e416d3d 100644 --- a/BGS/Report.cs +++ b/BGS/Report.cs @@ -34,7 +34,8 @@ namespace NonaBGS.BGS { e.Is(Events.FSDJump) || e.Is(Events.MultiSellExplorationData) || e.Is(Events.SellMicroResources) || - e.Is(Events.RedeemVoucher) + e.Is(Events.RedeemVoucher) || + e.Is(Events.FactionKillBond) ; } @@ -93,6 +94,14 @@ namespace NonaBGS.BGS { entry.Station = current_station; entry.Faction = controlling_faction; + collate = true; + } else if (e.Is(Events.FactionKillBond)) { + entry = new FactionKillBonds(); + entry.Entries.Add(e); + entry.System = current_system; + entry.Station = current_station; + entry.Faction = (e as FactionKillBondEntry).AwardingFaction; + collate = true; } else if (e.Is(Events.SellMicroResources)) { entry = new SellMicroResources(current_system, current_station); diff --git a/nonabgs.csproj b/nonabgs.csproj index 9b8ce12..d371944 100644 --- a/nonabgs.csproj +++ b/nonabgs.csproj @@ -41,8 +41,7 @@ packages\AutoCompleteTextBox.1.1.1\lib\net472\AutoCompleteTextBox.dll - - False + ..\edjournal\bin\Debug\EDJournal.dll @@ -77,6 +76,7 @@ +