Exemple #1
0
        static void Main(string[] args)
        {
            //初始化客户,服务员,厨师
            Client   wang     = new Client();
            Waitress waitress = new Waitress();
            Waitress zhang    = new Waitress();
            Chef     chef     = new Chef();

            //初始化菜单
            Order order = new Order();

            //设置订了改菜单的客户
            order.customer = wang;
            order.id       = 100;
            order.mealList = "水煮鱼";

            //顾客wang选中的waitress服务员给自己服务
            wang.Order(waitress, order);

            //服务员将菜单信息告知厨师chef
            waitress.SendOrder(chef);

            //厨师根据菜单做菜
            chef.Cook();
            chef.Sendalert(waitress);
            waitress.TransCook();
            Console.Read();
        }
Exemple #2
0
 //点菜
 public void Order(Waitress waitress, Order order)
 {
     Console.WriteLine("顾客开始点菜:{0}!", order.mealList);
     waitress.GetOrder(order);
 }
Exemple #3
0
 //提醒饭菜制作完毕
 public void Sendalert(Waitress waitress)
 {
     Console.WriteLine("厨师提示服务员取菜!");
     waitress.GetOrder(order);
 }