using System.Collections.Generic; using System.Linq; using Model.Entity; namespace Model.BuildOrders; public class BuildOrderModel { public string Name { get; set; } = ""; public string Color { get; set; } = "red"; public string Notes { get; set; } = @""; public List BuildTypes { get; set; } = new(); public int CurrentSupplyUsed { get; set; } = 0; public Dictionary> StartedOrders { get; set; } = new(); public Dictionary> CompletedOrders { get; set; } = new(); public Dictionary UniqueCompletedTimes { get; set; } = new(); public Dictionary UniqueCompletedCount { get; set; } = new(); public Dictionary SupplyCountTimes { get; set; } = new(); public List GetHarvestersCompletedBefore(int interval) { return (from ordersAtTime in StartedOrders from orders in ordersAtTime.Value where ordersAtTime.Key + (orders.Production() == null ? 0 : orders.Production().BuildTime) <= interval where orders.Harvest() != null select orders).ToList(); } }