示例#1
0
        static void Main(string[] args)
        {
            Garden myGarden     = new Garden();
            Tree   purpleTree   = new Tree("purple");
            Tree   orangeTree   = new Tree("orange");
            Flower yellowFlower = new Flower("yellow");
            Flower blueFlower   = new Flower("blue");

            myGarden.AddPlants(purpleTree, orangeTree, yellowFlower, blueFlower);

            Console.WriteLine(myGarden.StateOfTheGarden());
            Console.WriteLine();

            myGarden.Watering(40);
            Console.WriteLine(myGarden.StateOfTheGarden());
            Console.WriteLine();

            myGarden.Watering(70);
            Console.WriteLine(myGarden.StateOfTheGarden());
            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Flower yellowFlower = new Flower("yellow");
            Flower blueFlower   = new Flower("blue");
            Tree   purpleTree   = new Tree("purple");
            Tree   orangeTree   = new Tree("orange");

            Garden ofEden = new Garden("Garden of Eden");

            ofEden.AddFlower(yellowFlower);
            ofEden.AddFlower(blueFlower);
            ofEden.AddTree(purpleTree);
            ofEden.AddTree(orangeTree);

            ofEden.GetInfo();

            ofEden.Watering(40);

            ofEden.Watering(70);

            Console.ReadLine();
        }