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
+11
View File
@@ -11,4 +11,15 @@ public class EntityHarvestModel : IEntityPartInterface
public float HarvestDelay { get; set; } = 1;
public int TotalAmount { get; set; }
public bool RequiresWorker { get; set; }
public float StartedAt { get; set; }
public bool IsDepleted(float interval)
{
var lifeTime = interval - StartedAt;
var totalHarvested = (lifeTime - 1) * HarvestedPerInterval;
return totalHarvested > TotalAmount;
}
}