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"); }
//TODO public override void AddCoffeeGrains(CoffeeMachine context) { Console.WriteLine("Pojemnik na ziarna kawy pełny."); }
public override void MakeWhiteCoffee(CoffeeMachine context) { Console.WriteLine("Nie można zrobić kawy - brak ziaren i mleka."); }
public override void AddMilk(CoffeeMachine context) { context.State = new WithMilk(); Console.WriteLine("Dolano mleko."); }
//TODO public override void AddCoffeeGrains(CoffeeMachine context) { context.State = new WithCoffeeGrains(); Console.WriteLine("Dodano ziarna kawy."); }
public abstract void MakeWhiteCoffee(CoffeeMachine context);
public abstract void MakeBlackCoffee(CoffeeMachine context);
public abstract void AddMilk(CoffeeMachine context);
public abstract void AddCoffeeGrains(CoffeeMachine context);
public override void MakeWhiteCoffee(CoffeeMachine context) { context.State = new Empty(); Console.WriteLine("Robię białą kawę."); }
public override void MakeBlackCoffee(CoffeeMachine context) { context.State = new WithMilk(); Console.WriteLine("Robię czarną kawę."); }
public override void AddMilk(CoffeeMachine context) { }
public override void MakeWhiteCoffee(CoffeeMachine context) { }
public override void MakeBlackCoffee(CoffeeMachine context) { }