we still want profit info, just not BGS info
This commit is contained in:
parent
f4bbd3df2b
commit
87314d0258
@ -635,15 +635,22 @@ internal class SearchAndRescueParser : TransactionParserPart {
|
|||||||
|
|
||||||
internal class MarketBuyParser : TransactionParserPart {
|
internal class MarketBuyParser : TransactionParserPart {
|
||||||
public void Parse(Entry e, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
|
public void Parse(Entry e, TransactionParserContext context, TransactionParserOptions options, TransactionList transactions) {
|
||||||
if (options.IgnoreMarketBuy) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
MarketBuyEntry? entry = e as MarketBuyEntry;
|
MarketBuyEntry? entry = e as MarketBuyEntry;
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context.BoughtCargo(entry.Type, entry.BuyPrice);
|
||||||
|
|
||||||
|
// We still want the information on buy price for profit,
|
||||||
|
// but if the option is on, we don't care for parsing it
|
||||||
|
// further.
|
||||||
|
// TODO: might be wise to split this parser into two; one for
|
||||||
|
// determining profit, the other for the BGS information
|
||||||
|
if (options.IgnoreMarketBuy) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (context.StationOwner == null) {
|
if (context.StationOwner == null) {
|
||||||
transactions.AddIncomplete(
|
transactions.AddIncomplete(
|
||||||
new OrganicData(),
|
new OrganicData(),
|
||||||
@ -652,8 +659,6 @@ internal class MarketBuyParser : TransactionParserPart {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
context.BoughtCargo(entry.Type, entry.BuyPrice);
|
|
||||||
|
|
||||||
transactions.Add(new BuyCargo(entry) {
|
transactions.Add(new BuyCargo(entry) {
|
||||||
System = context.CurrentSystem,
|
System = context.CurrentSystem,
|
||||||
Station = context.CurrentStation,
|
Station = context.CurrentStation,
|
||||||
|
Loading…
Reference in New Issue
Block a user