fix voucher reporting after indepth BGS discussion on EDC

This commit is contained in:
2021-10-07 09:02:34 +02:00
parent 89fd36b5c4
commit 3eee75e814
5 changed files with 44 additions and 23 deletions

View File

@@ -7,6 +7,11 @@ namespace NonaBGS.BGS {
public class LogEntry : IComparable<LogEntry> {
private List<Entry> entries = new List<Entry>();
/// <summary>
/// Controlling faction of the station this entry was made/turned into.
/// </summary>
public string ControllingFaction { get; set; } = "";
public List<Entry> Entries => entries;
public string Station { get; set; }
public string System { get; set; }

View File

@@ -93,19 +93,17 @@ namespace NonaBGS.BGS {
entry.Entries.Add(e);
entry.System = current_system;
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;
entry.Faction = (e as RedeemVoucherEntry).Factions.First();
entry.ControllingFaction = controlling_faction;
collate = true;
} else if (e.Is(Events.SellMicroResources)) {
entry = new SellMicroResources(current_system, current_station);
entry = new SellMicroResources() {
Faction = controlling_faction,
Station = current_station,
System = current_system
};
entry.Entries.Add(e);
} else if (e.Is(Events.MarketSell)) {
entry = new SellCargo() {

View File

@@ -3,11 +3,6 @@ using EDJournal;
namespace NonaBGS.BGS {
public class SellMicroResources : LogEntry {
public SellMicroResources(string system, string station) {
System = system;
Station = station;
}
public int TotalSum {
get {
return Entries

View File

@@ -23,7 +23,13 @@ namespace NonaBGS.BGS {
.GroupBy(x => (x as RedeemVoucherEntry).Type)
.Select(x => x.Key)
.First();
type = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(v);
if (v == "CombatBond") {
type = "Combat Bond";
} else if (v == "bounty") {
type = "Bounty";
} else {
type = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(v);
}
}
return type;
@@ -46,10 +52,5 @@ namespace NonaBGS.BGS {
public override string ToString() {
return string.Format("{0} Vouchers: {1}", Type, Credits.FormatCredits(TotalSum));
}
/// <summary>
/// Vouchers only help the controlling faction
/// </summary>
public override bool OnlyControllingFaction => true;
}
}