Archived
1
0
This repository has been archived on 2021-10-19. You can view files and clone it, but cannot push or open issues or pull requests.
nonabgs/BGS/SellCargo.cs

32 lines
946 B
C#
Raw Normal View History

using System.Text;
using System.Linq;
using EDJournal;
namespace NonaBGS.BGS {
public class SellCargo : LogEntry {
public override string ToString() {
StringBuilder builder = new StringBuilder();
var sold = Entries.OfType<MarketSellEntry>().ToArray();
if (sold == null || sold.Length == 0) {
return builder.ToString();
}
foreach (MarketSellEntry sell in sold) {
builder.AppendFormat("Sold {0} {1} to the {2}\n",
sell.Count,
sell.Type,
sell.BlackMarket ? "Black Market" : "Commodity Market"
);
}
return builder.ToString().Trim();
}
/// <summary>
/// Selling resources to a market only helps the controlling faction
/// </summary>
public override bool OnlyControllingFaction => true;
}
}