Exemplo n.º 1
0
 // EXAMPLE
 public static void DrawTree(int x, int y)
 {
     McRectangle trunk        = new McRectangle(x + 10, y + 20, 20, 60, "brown");
     McCircle    leftLeaves   = new McCircle(x, y + 20, 20, "green");
     McCircle    middleLeaves = new McCircle(x + 20, y + 10, 20, "green");
     McCircle    rightLeaves  = new McCircle(x + 40, y + 20, 20, "green");
 }
Exemplo n.º 2
0
 public McDrawing(Control control)
 {
     _control = control;
     _shapes  = new List <IMcShape>();
     // Attach each type of shape to this McDrawing
     McPoint.SetDrawing(this);
     McRectangle.SetDrawing(this);
     McCircle.SetDrawing(this);
 }
Exemplo n.º 3
0
        public DrawTriangle(int x, int y, int sideLength, string color)
        {
            int a = sideLength;

            if (sideLength % 2 != 0)
            {
                sideLength++;
            }
            for (int i = 0; i < sideLength; i++)
            {
                for (int j = 0; j < a; j++)
                {
                    McRectangle buildingBlock = new McRectangle(x + i * 10, x + j * 10, 15, 15, color);
                }
                a--;
            }
        }