コード例 #1
0
        private Vegetable Cut(Vegetable vegetableObject)
        {
            if (vegetableObject.IsRotten)
            {
                vegetableObject.IsRotten = false;
            }

            return new Vegetable(vegetableObject);
        }
コード例 #2
0
        private Vegetable Peel(Vegetable vegetableObject)
        {
            if (!vegetableObject.IsPeeled)
            {
                vegetableObject.IsPeeled = true;
            }

            return new Vegetable(vegetableObject);
        }
コード例 #3
0
        public void Cook(Vegetable currentVegetable)
        {
            bowl = GetBowl();

            currentVegetable = Cut(currentVegetable);
            currentVegetable = Peel(currentVegetable);

            bowl.Add(currentVegetable);
        }