Files
IGP-Fan-Reference/Model/Entity/Parts/EntityHarvestModel.cs
T
2025-06-22 18:46:51 -04:00

24 lines
694 B
C#

using Model.Types;
namespace Model.Entity.Parts;
public class EntityHarvestModel : IEntityPartInterface
{
public string Type { get; set; } = "EntityHarvestModel";
public ResourceType Resource { get; set; } = ResourceType.Alloy;
public float Slots { get; set; }
public float HarvestedPerInterval { get; set; }
public float HarvestDelay { get; set; } = 1;
public int TotalAmount { get; set; }
public bool RequiresWorker { get; set; }
public bool IsDepleted(float interval, float startedAt)
{
var lifeTime = interval - startedAt;
var totalHarvested = lifeTime * HarvestedPerInterval;
return totalHarvested > TotalAmount;
}
}