feature(BuildCalc) Added reset button, can change micro delay, and can alter timing interval again

This commit is contained in:
2022-04-14 22:28:14 -04:00
parent 4cef578cd0
commit 04c1718259
115 changed files with 1561 additions and 1308 deletions
+7 -68
View File
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Model.Entity;
using Model.Entity.Data;
namespace Model.BuildOrders;
@@ -9,76 +8,16 @@ 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()
{
{
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 Dictionary<string, int> UniqueCompletedTimes { get; set; } = new()
{
{
DataType.STARTING_Bastion, 0
},
{
DataType.STARTING_TownHall_Aru, 0
}
};
public Dictionary<string, int> UniqueCompletedCount { get; set; } = new()
{
{
DataType.STARTING_Bastion, 1
},
{
DataType.STARTING_TownHall_Aru, 1
}
};
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> 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 int CurrentSupplyUsed { get; set; } = 0;
public Dictionary<int, List<EntityModel>> StartedOrders { get; set; } = new();
public Dictionary<int, List<EntityModel>> CompletedOrders { get; set; } = new();
public Dictionary<string, int> UniqueCompletedTimes { get; set; } = new();
public Dictionary<string, int> UniqueCompletedCount { get; set; } = new();
public Dictionary<int, int> SupplyCountTimes { get; set; } = new();
public List<EntityModel> GetHarvestersCompletedBefore(int interval)
{
return (from ordersAtTime in StartedOrders