예제 #1
0
        private void AddBeverageBtn_Click(object sender, EventArgs e)
        {
            button2.Enabled = true;
            switch (DecoratorCB.SelectedItem)
            {
            case "Mocha":
                coffee = new Mocha(coffee);
                break;

            case "Latte":
                coffee = new Milk(coffee);
                break;

            case "Caramel":
                coffee = new Caramel(coffee);
                break;

            case "Iced":
                coffee = new Ice(coffee);
                break;
            }
            double x = coffee.Cost();

            user.Compute(this, BillTB.Text, bill);
            bill += x;
            string BillText = $"\n {coffee.GetDescription()}\t\t{x} tl \n ";

            BillTB.Text += BillText;
        }
예제 #2
0
 public override double Cost() => coffee.Cost();