Exemplo n.º 1
0
        public static void Main()
        {
            IKitchenMediator mediator = new KitchenMediator();

            Employee waiter = new Waiter(Constants.DisplayWaiter, mediator);
            Employee cook   = new Cook(Constants.DisplayCook, mediator);

            mediator.Register(waiter);
            mediator.Register(cook);

            waiter.Send(Constants.DisplayCook, PrintMessages.Ordered);
            cook.Send(Constants.DisplayWaiter, PrintMessages.Ready);
        }
Exemplo n.º 2
0
        public static void Main()
        {
            IKitchenMediator mediator = new KitchenMediator();

            string john  = Constants.DisplayJohn;
            string peter = Constants.DisplayPeter;

            Employee waiter = new Waiter(john, mediator);
            Employee cook   = new Cook(peter, mediator);

            mediator.Register(waiter);
            mediator.Register(cook);

            waiter.Send(john, PrintMessages.Ordered);
            cook.Send(peter, PrintMessages.Ready);
        }