示例#1
0
        public void Cook(params Vegetable[] vegetables)
        {
            Bowl bowl = GetBowl();

            foreach (Vegetable vegetable in vegetables)
            {
                bowl.Add(vegetable);
            }
        }
示例#2
0
        public void Cook()
        {
            Potato potato = this.GetPotato();
            Carrot carrot = this.GetCarrot();

            Peel(potato);
            Peel(carrot);
            this.Cut(potato);
            this.Cut(carrot);
            Bowl bowl = this.GetBowl();

            bowl.Add(carrot);
            bowl.Add(potato);
        }
示例#3
0
        public void Cook()
        {
            Bowl bowl = GetBowl();

            Potato potato = GetPotato();

            Peel(potato);
            Cut(potato);
            bowl.Add(potato);

            Carrot carrot = GetCarrot();

            Peel(carrot);
            Cut(carrot);
            bowl.Add(carrot);
        }
示例#4
0
        public Bowl Cook()
        {
            Potato potato = GetPotato();

            Peel(potato);
            Cut(potato);

            Carrot carrot = GetCarrot();

            Peel(carrot);
            Cut(carrot);

            Bowl bowl = GetBowl();

            bowl.Add(carrot);
            bowl.Add(potato);

            return(bowl);
        }
示例#5
0
        static void Main(string[] args)
        {
            IVegetable carrot = new Carrot();
            IVegetable patato = new Patato();
            IVegetable paper  = new Paper();

            IVegetable vegetables = new Vegetables();

            IAppearance bowl    = new Bowl();
            IAppearance steamer = new Steamer();

            Chef chef = new Chef();

            chef.Wash();
            chef.Cut();
            chef.Prepare(bowl);
            chef.Cook(steamer);
            chef.Serve();
        }
示例#6
0
 private Bowl GetBowl()
 {
     var bowl = new Bowl();
     return bowl;
 }