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));
        }
Пример #2
0
        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());
 }
Пример #4
0
 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);
 }