예제 #1
0
        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));
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 public abstract void StartBrew(CoffeeMakeModel currentCoffeeModel);