using EDPlayerJournal.BGS;
using System.Linq;

namespace EliteBGS.LogGenerator;

public class MarketBuyFormat : GenericFormat<BuyCargo> {
    public override string GenerateSummary(Objective objective) {
        long tons = objective
            .EnabledOfType<BuyCargo>()
            .Sum(x => x.Amount)
            ;
        if (tons <= 0) {
            return "";
        }
        return string.Format("Bought: {0}t", tons);
    }
}
