public override void StartBrew(CoffeeMakeModel coffeeModel) { if (status != Status.Idle) { Debug.LogWarning($"Can't brew because machine is {status}"); return; } SetStatus(Status.Busy); brewingProcess = StartCoroutine(Brew(coffeeModel)); }
private IEnumerator Brew(CoffeeMakeModel coffeeModel) { MyLog.TryLog(this, $"Brewing...", debug); MyLog.TryLog(this, $"{coffeeModel.waterFlowRate}", debug); MyLog.TryLog(this, $"{coffeeModel.waterAmount}", debug); coffeeGrinder.StartProcessing(coffeeAmount); yield return(new WaitUntil(() => coffeeGrinder.Status == Status.Idle)); waterPump.StartProcessing(coffeeModel.waterAmount, coffeeModel.waterFlowRate); yield return(new WaitUntil(() => waterPump.Status == Status.Idle)); OnBrewSuccess.Invoke(); SetStatus(Status.Idle); }
public void Brew() { MyLog.TryLog(this, "Started brewing", debug); if (hasWarnings) { MyLog.TryLog(this, "Has warnings, aborting brewing", debug); return; } SetCurrentCoffeeName(); SetStatus(Status.Busy, currentCoffee.coffeeName); display.ClearTimedMsg(); CoffeeMakeModel model = ConstructCoffeeMakeModel(currentCoffee); brewModule.StartBrew(model); }
public abstract void StartBrew(CoffeeMakeModel currentCoffeeModel);