34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
|
using EDPlayerJournal.Entries;
|
|||
|
|
|||
|
namespace EDPlayerJournal.BGS;
|
|||
|
|
|||
|
internal class MultiSellExplorationDataParser : ITransactionParserPart {
|
|||
|
public void Parse(Entry e, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
|
|||
|
MultiSellExplorationDataEntry? entry = e as MultiSellExplorationDataEntry;
|
|||
|
if (entry == null) {
|
|||
|
throw new NotImplementedException();
|
|||
|
}
|
|||
|
|
|||
|
if (context.StationOwner == null) {
|
|||
|
transactions.AddIncomplete(
|
|||
|
new Cartographics(),
|
|||
|
"Could not discern the station owner for cartographics sell.",
|
|||
|
e);
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
// Ignore if its a fleet carrier faction.
|
|||
|
if (string.Compare(context.StationOwner, Factions.FleetCarrier, StringComparison.OrdinalIgnoreCase) == 0 &&
|
|||
|
options.IgnoreFleetCarrierFaction) {
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
transactions.Add(new Cartographics(entry) {
|
|||
|
System = context.CurrentSystem,
|
|||
|
Station = context.CurrentStation,
|
|||
|
Faction = context.StationOwner,
|
|||
|
IsLegacy = context.IsLegacy,
|
|||
|
});
|
|||
|
}
|
|||
|
}
|