private void ProcessRequest(EnergyRequireingRequestComponent request) { if (HasEnoughEnergy(request.EnergyCost)) { PayRequestCost(request.EnergyCost); PerformRequest(request); } else { RejectRequest(request); } }
private void RejectRequest(EnergyRequireingRequestComponent request) { request.OnFailure.InvokeIfNotNull(); }
private void PerformRequest(EnergyRequireingRequestComponent request) { request.OnSuccess.InvokeIfNotNull(); }