using System.Linq;
using EDJournal;

namespace NonaBGS.BGS {
    public class SellMicroResources : LogEntry {
        public SellMicroResources(string system, string station) {
            System = system;
            Station = station;
        }

        public int TotalSum {
            get {
                return Entries
                       .Where(x => x.GetType() == typeof(SellMicroResourcesEntry))
                       .Sum(x => (x as SellMicroResourcesEntry).Price)
                       ;
            }
        }

        public override string ToString() {
            return string.Format("Sell Micro Resources: {0}", Credits.FormatCredits(TotalSum));
        }

        public override bool OnlyControllingFaction => true;
    }
}