public bool OpenLevel(int x)
    {
        // Generate empty drink
        CurDrink = Instantiate(drinkModel);

        // Read level Setting
        CurDrink.requirement = levelData[x];

        // Enable / trigger in
        CurDrink.gameObject.SetActive(true);

        return(true);        // Open successfully
    }
Exemple #2
0
        public Recipe GetRecipe(DrinkTypeEnum drinkType)
        {
            IDrink drink;

            switch (drinkType)
            {
            case DrinkTypeEnum.Tea:
                drink = new TeaDrink();
                break;

            case DrinkTypeEnum.Coffee:
                drink = new CoffeeDrink();
                break;

            case DrinkTypeEnum.HotChocolate:
                drink = new HotChocolateDrink();
                break;

            default:
                drink = new CoffeeDrink();
                break;
            }
            return(drink.Recipe);
        }
        private void BrewDrink()
        {
            IDrink drink;

            switch (_drinkName)
            {
            case "Coffee":
                drink = new Coffee()
                {
                    Strength = CoffeeStrength
                };
                break;

            case "Espresso":
                drink = new Espresso();
                break;

            case "Capuccino":
                drink = new Capuccino();
                break;

            case "Wiener Melange":
                drink = new WienerMelange();
                break;

            case "Café au Lait":
                drink = new CafeAuLait();
                break;

            case "Chocolate":
                drink = new Chocolate();
                break;

            case "Chocolate Deluxe":
                drink = new Chocolate(makeDeluxe: true);
                break;

            case "Tea":
                TeaBlend teaBlend = _teaBlendRepository.GetTeaBlend(SelectedTeaBlendOption);
                if (_hasSugar)
                {
                    drink = new TeaDrink(teaBlend, sugeramount: (int)SugarAmount);
                }
                else
                {
                    drink = new TeaDrink(teaBlend);
                }
                break;

            default:
                drink = _fh.GetBaseDrink(_drinkName);
                break;;
            }

            if (_hasSugar)
            {
                drink = new SugarDecorator(drink, _sugarAmount);
            }

            if (_hasMilk)
            {
                drink = new MilkDecorator(drink, _milkAmount);
            }

            SelectedDrink = drink;
        }
Exemple #4
0
 public void SetDrink(TeaDrink d)
 {
     drink = d;
 }