示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Ekspres do kawy");
            Console.WriteLine("1: Wsyp ziarno");
            Console.WriteLine("2: Wlej mleko");
            Console.WriteLine("3: Zrób czarną kawę");
            Console.WriteLine("4: Zrób białą kawę");

            var machine = new CoffeeMachine();

            machine.Process("3");
            machine.Process("4");
            machine.Process("1");
            machine.Process("4");
            machine.Process("2");
            machine.Process("4");
            machine.Process("1");
            machine.Process("1");
            machine.Process("2");
            machine.Process("3");
            machine.Process("1");
            machine.Process("4");
        }
示例#2
0
 //TODO
 public override void AddCoffeeGrains(CoffeeMachine context)
 {
     Console.WriteLine("Pojemnik na ziarna kawy pełny.");
 }
示例#3
0
 public override void MakeWhiteCoffee(CoffeeMachine context)
 {
     Console.WriteLine("Nie można zrobić kawy - brak ziaren i mleka.");
 }
示例#4
0
 public override void AddMilk(CoffeeMachine context)
 {
     context.State = new WithMilk();
     Console.WriteLine("Dolano mleko.");
 }
示例#5
0
 //TODO
 public override void AddCoffeeGrains(CoffeeMachine context)
 {
     context.State = new WithCoffeeGrains();
     Console.WriteLine("Dodano ziarna kawy.");
 }
示例#6
0
 public abstract void MakeWhiteCoffee(CoffeeMachine context);
示例#7
0
 public abstract void MakeBlackCoffee(CoffeeMachine context);
示例#8
0
 public abstract void AddMilk(CoffeeMachine context);
示例#9
0
 public abstract void AddCoffeeGrains(CoffeeMachine context);
示例#10
0
 public override void MakeWhiteCoffee(CoffeeMachine context)
 {
     context.State = new Empty();
     Console.WriteLine("Robię białą kawę.");
 }
示例#11
0
 public override void MakeBlackCoffee(CoffeeMachine context)
 {
     context.State = new WithMilk();
     Console.WriteLine("Robię czarną kawę.");
 }
示例#12
0
 public override void AddMilk(CoffeeMachine context)
 {
 }
示例#13
0
 public override void MakeWhiteCoffee(CoffeeMachine context)
 {
 }
示例#14
0
 public override void MakeBlackCoffee(CoffeeMachine context)
 {
 }