You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.3 KiB
75 lines
2.3 KiB
using System.Collections.Generic; |
|
using System.Linq; |
|
using Model.Entity; |
|
using Model.Entity.Data; |
|
|
|
namespace Model.BuildOrders; |
|
|
|
public class BuildOrderModel |
|
{ |
|
public string Name { get; set; } = ""; |
|
public string Color { get; set; } = "red"; |
|
|
|
public Dictionary<int, List<EntityModel>> StartedOrders { get; set; } = new() |
|
{ |
|
{ |
|
0, |
|
new List<EntityModel> |
|
{ |
|
EntityModel.Get(DataType.STARTING_Bastion), |
|
EntityModel.Get(DataType.STARTING_TownHall_Aru) |
|
} |
|
} |
|
}; |
|
|
|
public Dictionary<int, List<EntityModel>> CompletedOrders { get; set; } = new() |
|
{ |
|
{ |
|
0, |
|
new List<EntityModel> |
|
{ |
|
EntityModel.Get(DataType.STARTING_Bastion), |
|
EntityModel.Get(DataType.STARTING_TownHall_Aru) |
|
} |
|
} |
|
}; |
|
|
|
public string Notes { get; set; } = @""; |
|
|
|
public List<string> BuildTypes { get; set; } = new(); |
|
|
|
|
|
public List<EntityModel> GetOrdersAt(int interval) |
|
{ |
|
return (from ordersAtTime in StartedOrders |
|
from orders in ordersAtTime.Value |
|
where ordersAtTime.Key == interval |
|
select orders).ToList(); |
|
} |
|
|
|
public List<EntityModel> GetCompletedAt(int interval) |
|
{ |
|
return (from ordersAtTime in StartedOrders |
|
from orders in ordersAtTime.Value |
|
where ordersAtTime.Key + (orders.Production() == null ? 0 : orders.Production().BuildTime) == interval |
|
select orders).ToList(); |
|
} |
|
|
|
public List<EntityModel> GetCompletedBefore(int interval) |
|
{ |
|
return (from ordersAtTime in StartedOrders |
|
from orders in ordersAtTime.Value |
|
where ordersAtTime.Key >= interval |
|
where ordersAtTime.Key + (orders.Production() == null ? 0 : orders.Production().BuildTime) <= interval |
|
select orders).ToList(); |
|
} |
|
|
|
public List<EntityModel> 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(); |
|
} |
|
} |