Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            List <Flower> flowers = new List <Flower>();
            List <Tree>   trees   = new List <Tree>();

            var yellow = new Flower("yellow");
            var blue   = new Flower("blue");
            var purple = new Tree("purple");
            var orange = new Tree("orange");

            flowers.Add(yellow);
            flowers.Add(blue);
            trees.Add(purple);
            trees.Add(orange);

            Garden.Flowers = flowers;
            Garden.Trees   = trees;

            Garden.Trees.Add(purple);

            Garden.PrintGarden();
            Garden.WatteringGarden(40);
            Garden.PrintGarden();
            Garden.WatteringGarden(70);
            Garden.PrintGarden();
        }
Ejemplo n.º 2
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();
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            Flower pink = new Flower("pink");

            pink.WaterAmount = 8;

            Flower blue = new Flower("blue");

            blue.WaterAmount = 3;

            Tree green = new Tree("green");

            green.WaterAmount = 20;
            Tree brown = new Tree("brown");

            brown.WaterAmount = 5;
            Garden garden = new Garden();

            garden.AddFlower(pink);
            garden.AddFlower(blue);
            garden.AddTree(green);
            garden.AddTree(brown);
            garden.watering(40);
        }