Пример #1
0
 public override void Rotate()
 {
     afterRotate = new Cubes[4];
     if (rotation == 2 || rotation == 4)
     {
         afterRotate[1] = new Cubes(currentPos, color);
         afterRotate[0] = new Cubes(new Point(currentPos.X, currentPos.Y + gridSize), color);
         afterRotate[2] = new Cubes(new Point(currentPos.X - gridSize, currentPos.Y), color);
         afterRotate[3] = new Cubes(new Point(currentPos.X - gridSize, currentPos.Y - gridSize), color);
     }
     if (rotation == 1 || rotation == 3)
     {
         afterRotate[1] = new Cubes(currentPos, color);
         afterRotate[0] = new Cubes(new Point(currentPos.X - gridSize, currentPos.Y), color);
         afterRotate[2] = new Cubes(new Point(currentPos.X, currentPos.Y - gridSize), color);
         afterRotate[3] = new Cubes(new Point(currentPos.X + gridSize, currentPos.Y - gridSize), color);
     }
     if (RotationCheck())
     {
         rotation++;
         if (rotation == 5)
         {
             rotation = 1;
         }
         activeCubes = afterRotate;
     }
 }
Пример #2
0
 public Square(Point point)
 {
     this.currentPos = point;
     activeCubes[0]  = new Cubes(point, Color.Yellow);
     activeCubes[1]  = new Cubes(new Point(point.X + gridSize, point.Y), Color.Yellow);
     activeCubes[2]  = new Cubes(new Point(point.X, point.Y - gridSize), Color.Yellow);
     activeCubes[3]  = new Cubes(new Point(point.X + gridSize, point.Y - gridSize), Color.Yellow);
 }
Пример #3
0
 public TSymbol(Point point)
 {
     color           = Color.Purple;
     this.currentPos = point;
     activeCubes[1]  = new Cubes(point, Color.Purple);
     activeCubes[0]  = new Cubes(new Point(point.X - gridSize, point.Y), Color.Purple);
     activeCubes[2]  = new Cubes(new Point(point.X + gridSize, point.Y), Color.Purple);
     activeCubes[3]  = new Cubes(new Point(point.X, point.Y - gridSize), Color.Purple);
 }
Пример #4
0
 public S2(Point point)
 {
     this.currentPos = point;
     color           = Color.Green;
     activeCubes[1]  = new Cubes(point, color);
     activeCubes[0]  = new Cubes(new Point(point.X, point.Y + gridSize), color);
     activeCubes[2]  = new Cubes(new Point(point.X - gridSize, point.Y), color);
     activeCubes[3]  = new Cubes(new Point(point.X - gridSize, point.Y - gridSize), color);
 }
Пример #5
0
 public Stick(Point point)
 {
     color           = Color.Cyan;
     this.currentPos = point;
     activeCubes[0]  = new Cubes(new Point(currentPos.X, currentPos.Y - gridSize), color);
     activeCubes[1]  = new Cubes(new Point(currentPos.X - gridSize, currentPos.Y - gridSize), color);
     activeCubes[2]  = new Cubes(new Point(currentPos.X + gridSize, currentPos.Y - gridSize), color);
     activeCubes[3]  = new Cubes(new Point(currentPos.X + gridSize * 2, currentPos.Y - gridSize), color);
 }
Пример #6
0
 public L2(Point point)
 {
     color          = Color.Blue;
     currentPos     = point;
     activeCubes[1] = new Cubes(point, color);
     activeCubes[0] = new Cubes(new Point(point.X - gridSize, point.Y), color);
     activeCubes[2] = new Cubes(new Point(point.X + gridSize, point.Y), color);
     activeCubes[3] = new Cubes(new Point(point.X - gridSize, point.Y - gridSize), color);
 }
Пример #7
0
 public L1(Point point)
 {
     base.currentPos = point;
     color           = Color.Orange;
     activeCubes[1]  = new Cubes(point, color);
     activeCubes[0]  = new Cubes(new Point(point.X + gridSize, point.Y), color);
     activeCubes[2]  = new Cubes(new Point(point.X - gridSize, point.Y), color);
     activeCubes[3]  = new Cubes(new Point(point.X + gridSize, point.Y - gridSize), color);
 }
Пример #8
0
 /// <summary>
 /// Return the column of the cube
 /// </summary>
 /// <param name="cube"></param>
 /// <returns></returns>
 public static int ColumnNumber(Cubes cube)
 {
     return(((cube.point.X - (maxLeftPos - gridSize)) / gridSize) - 1);
 }
Пример #9
0
        } //End ClearRows()

        /// <summary>
        /// Return the row of the cube
        /// </summary>
        /// <param name="cube"></param>
        /// <returns></returns>
        public static int RowNumber(Cubes cube)
        {
            return((cube.point.Y - startPos.Y) / gridSize);
        }