Пример #1
0
        public Tetrominoes(int figNumber, Colors shapeColor)
        {
            sC        = SetCell;
            setFigure = new Point[4];
            pointsB   = new Point[4];
            FigCount  = 7;
            PosCount  = 4;
            mask      = new int[7][];

            mask[0] = new int[] { 1, 3, 5, 7 };
            mask[1] = new int[] { 2, 4, 5, 7 };
            mask[2] = new int[] { 3, 5, 4, 6 };
            mask[3] = new int[] { 3, 5, 4, 7 };
            mask[4] = new int[] { 2, 3, 5, 7 };
            mask[5] = new int[] { 3, 5, 7, 6 };
            mask[6] = new int[] { 2, 3, 4, 5 };

            figures = new Rect[FigCount][];
            for (int i = 0; i < FigCount; i++)
            {
                figures[i] = new Rect[PosCount];
            }

            for (int x = 0; x < FigCount; x++)
            {
                for (int y = 0; y < PosCount; y++)
                {
                    setFigure[y].X = mask[figNumber][y] % 2;
                    setFigure[y].Y = mask[figNumber][y] / 2;
                    sC(ColorsAdapter.GetColor(shapeColor), setFigure[y].X, setFigure[y].Y);
                }
            }
        }
Пример #2
0
 public Field()
 {
     cells = new Rect[FX][];
     sC    = SetCell;
     for (int i = 0; i < FX; i++)
     {
         cells[i] = new Rect[FY];
     }
     for (int x = 0; x < FX; x++)
     {
         for (int y = 0; y < FY; y++)
         {
             sC(Color.White, x, y);
         }
     }
 }