private void OnHarvest(ResponseHandle <Harvestable.Commands.Harvest, HarvestRequest, HarvestResponse> request) { var resourcesToGive = Mathf.Min(SimulationSettings.HarvestReturnQuantity, health.Data.currentHealth); health.AddCurrentHealthDelta(-resourcesToGive); request.Respond(new HarvestResponse(resourcesToGive)); }
private HarvestResponse OnHarvest(HarvestRequest request, ICommandCallerInfo callerinfo) { var resourcesToGive = Mathf.Min(SimulationSettings.HarvestReturnQuantity, health.Data.currentHealth); health.AddCurrentHealthDelta(-resourcesToGive); return(new HarvestResponse(resourcesToGive)); }
private void OnAddResource(Improbable.Entity.Component.ResponseHandle <StockpileDepository.Commands.AddResource, AddResource, Improbable.Core.Nothing> request) { if (stockpileDepository.Data.canAcceptResources) { health.AddCurrentHealthDelta(request.Request.quantity); } request.Respond(new Nothing()); }
private Nothing OnAddResource(AddResource request, ICommandCallerInfo callerinfo) { if (stockpileDepository.Data.canAcceptResources) { health.AddCurrentHealthDelta(request.quantity); } return(new Nothing()); }
private void TakeDamageFromFire() { health.AddCurrentHealthDelta(-SimulationSettings.FireDamagePerTick); }