From d6acbda55c133a4b78acb6c577d3eff07692ead6 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Wed, 19 Apr 2023 09:06:54 +0200 Subject: [PATCH] add option to ignore market buy --- EDPlayerJournal/BGS/TransactionParser.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/EDPlayerJournal/BGS/TransactionParser.cs b/EDPlayerJournal/BGS/TransactionParser.cs index 2ea4c83..4ff0a6f 100644 --- a/EDPlayerJournal/BGS/TransactionParser.cs +++ b/EDPlayerJournal/BGS/TransactionParser.cs @@ -14,6 +14,14 @@ public class TransactionParserOptions { /// primary faction for the influence. /// public bool IgnoreInfluenceSupport { get; set; } = false; + + /// + /// Whether to ignore market buy. Buying from a market gives a small amount + /// of INF if it is sold to a high demand market, but generally one buys from + /// a market to aid the faction the stuff is being sold to. So allow it to be + /// disabled. + /// + public bool IgnoreMarketBuy { get; set; } = false; } public class TransactionList : List { @@ -627,6 +635,10 @@ internal class SearchAndRescueParser : TransactionParserPart { internal class MarketBuyParser : TransactionParserPart { public void Parse(Entry e, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) { + if (options.IgnoreMarketBuy) { + return; + } + MarketBuyEntry? entry = e as MarketBuyEntry; if (entry == null) { throw new NotImplementedException();