Exemplo n.º 1
0
        static void Main()
        {
            var treeTypeFactory = new TreeTypeFactory();
            var forest          = new Forest(treeTypeFactory, "grass");

            forest.PlantTree(1, 1, "Green Big", "green");
            forest.PlantTree(2, 2, "Blue Small", "blue");
            forest.PlantTree(3, 3, "Green Big", "green");
            forest.PlantTree(4, 4, "Blue Small", "blue");
            Console.WriteLine();

            forest.Draw();
        }
Exemplo n.º 2
0
 public Forest(TreeTypeFactory treeTypeFactory, string surface)
 {
     _treeTypeFactory = treeTypeFactory;
     _surface         = surface;
 }