feat(BuildCalc) Optimized the build calculator
This commit is contained in:
@@ -9,6 +9,8 @@ public class BuildOrderModel
|
||||
{
|
||||
public string Name { get; set; } = "";
|
||||
public string Color { get; set; } = "red";
|
||||
|
||||
public int CurrentSupplyUsed { get; set; } = 0;
|
||||
|
||||
public Dictionary<int, List<EntityModel>> StartedOrders { get; set; } = new()
|
||||
{
|
||||
@@ -33,28 +35,28 @@ public class BuildOrderModel
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public Dictionary<string, int> UniqueCompletedTimes { get; set; } = new()
|
||||
{
|
||||
{
|
||||
DataType.STARTING_Bastion, 0
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
public Dictionary<int, int> SupplyCountTimes { get; set; } = new()
|
||||
{
|
||||
{
|
||||
0, 0
|
||||
}
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user