コード例 #1
0
        public bool ConfirmPayment(IHotDrink drink)
        {
            //Payment With Coins
            //Payment payment = new CoinPayment();

            //// Payment With Mobile Pay
            Payment payment = new MobilePayAdapter();

            payment.PrintPaymentDetails(drink);
            string paymentId = Console.ReadLine().ToLower();

            return(payment.Pay(paymentId));
        }
コード例 #2
0
 public DrinkDecorator(IHotDrink decoratedDrink)
 {
     this.decoratedDrink = decoratedDrink;
 }
コード例 #3
0
 public MilkyDrinkDecorator(IHotDrink decoratedDrink) : base(decoratedDrink)
 {
 }
コード例 #4
0
 private void AddMilk(IHotDrink decoratedDrink)
 {
     Console.Clear();
     Console.WriteLine("Added milk to your drink.");
     Thread.Sleep(2000);
 }