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
+11 -16
View File
@@ -100,27 +100,23 @@ public class EconomyOverTimeModel
// Remove Funds from Build Order
if (buildOrder.StartedOrders.TryGetValue(interval, out var ordersAtTime))
{
foreach (var order in ordersAtTime)
{
var foundEntity = EntityModel.GetDictionary()[order.DataType];
var production = foundEntity.Production();
if (production != null)
foreach (var order in ordersAtTime)
{
economyAtSecond.Alloy -= production.Alloy;
economyAtSecond.Ether -= production.Ether;
var finishedAt = interval + production.BuildTime;
var foundEntity = EntityModel.GetDictionary()[order.DataType];
var production = foundEntity.Production();
if (production.RequiresWorker) economyAtSecond.BusyWorkerCount += 1;
if (production != null)
{
economyAtSecond.Alloy -= production.Alloy;
economyAtSecond.Ether -= production.Ether;
var finishedAt = interval + production.BuildTime;
if (production.RequiresWorker) economyAtSecond.BusyWorkerCount += 1;
}
}
}
}
// Handle new entities
if (buildOrder.StartedOrders.TryGetValue(interval, out var ordersCompletedAtTime))
{
foreach (var newEntity in ordersCompletedAtTime)
{
var harvest = newEntity;
@@ -129,7 +125,6 @@ public class EconomyOverTimeModel
var production = newEntity.Production();
if (production != null && production.RequiresWorker) economyAtSecond.BusyWorkerCount -= 1;
}
}
}
}
}