Harvest points can now be depleted

This commit is contained in:
Jonathan
2025-06-14 21:38:03 -04:00
parent a5964a68f8
commit 826717c47f
15 changed files with 52 additions and 38 deletions
+6 -5
View File
@@ -172,7 +172,7 @@ public class BuildOrderService : IBuildOrderService
if (supply == null || supply.Takes.Equals(0)) return 0;
foreach (var supplyAtTime in
foreach (var supplyAtTime in
_buildOrder.SupplyCountTimes
.Where(supplyAtTime => supply.Takes + _buildOrder.CurrentSupplyUsed <= supplyAtTime.Key))
return supplyAtTime.Value;
@@ -198,7 +198,7 @@ public class BuildOrderService : IBuildOrderService
public void RemoveLast()
{
if (_buildOrder.StartedOrders.Keys.Count <= 1) return;
if (_buildOrder.StartedOrders.Count == 0)
{
_buildOrder.StartedOrders.Remove(_buildOrder.StartedOrders.Last().Key);
@@ -357,9 +357,10 @@ public class BuildOrderService : IBuildOrderService
while (true)
{
var usedSlots = 0;
foreach (var used in
foreach (var used in
_buildOrder.TrainingCapacityUsed
.Where(used => checkedInterval >= used.StartingUsageTime && checkedInterval < used.StopUsageTime))
.Where(used =>
checkedInterval >= used.StartingUsageTime && checkedInterval < used.StopUsageTime))
{
usedSlots += used.UsedSlots;
var duration = used.StopUsageTime - used.StartingUsageTime;
@@ -399,7 +400,7 @@ public class BuildOrderService : IBuildOrderService
if (!(economyAtSecond.Alloy >= production.Alloy)
|| !(economyAtSecond.Ether >= production.Ether)
|| !(economyAtSecond.Pyre >= production.Pyre)) continue;
atInterval = interval;
if (entity.EntityType != EntityType.Army) atInterval += _timingService.BuildingInputDelay;