示例#1
0
        public void FeedDino()
        {
            Food food;

            if (dinosaur.diet == Dinosaur.DietType.Carnivore)
            {
                food = new Meat(1);
            }
            else
            {
                food = new Vegetable(2);
            }

            dinosaur.Consume(food);
        }