Exemple #1
0
        public static void Test3()
        {
            Console.WriteLine("_________________________________________");
            var group1  = new ShapeGroup("*");
            var circle1 = new Circle(2);
            var sphere1 = new Sphere(2);
            var square1 = new Square(3);

            group1.AddToGroup(circle1);
            group1.AddToGroup(sphere1);
            group1.AddToGroup(square1);

            var group2  = new ShapeGroup("+");
            var square2 = new Square(1);
            var sphere2 = new Sphere(1);

            group2.AddToGroup(square2);
            group2.AddToGroup(sphere2);
            group2.AddToGroup(group1);

            var group3  = new ShapeGroup("*");
            var square3 = new Square(1);
            var sphere3 = new Sphere(2);

            group3.AddToGroup(square3);
            group3.AddToGroup(sphere3);
            group3.AddToGroup(group2);

            group3.About();
            Console.WriteLine("_________________________________________");
        }
Exemple #2
0
        public static void Test4()
        {
            Console.WriteLine("_________________________________________");
            var group1 = new ShapeGroup("*");

            group1.About();
            var group2 = new ShapeGroup("+");

            group2.AddToGroup(group1);
            group1.AddToGroup(group2);
            group2.About();
            Console.WriteLine("_________________________________________");
        }