Fan website of IMMORTAL: Gates of Pyre.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

25 lines
724 B

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 float StartedAt { get; set; }
public bool IsDepleted(float interval)
{
var lifeTime = interval - StartedAt;
var totalHarvested = (lifeTime - 1) * HarvestedPerInterval;
return totalHarvested > TotalAmount;
}
}