Example #1
0
 public void Rotate()
 {
     if (isCurrentPieceRotable())
     {
         SweapPiecePosition();
         t.Rotate();
         PrintPiece();
     }
 }
Example #2
0
        public bool isCurrentPieceRotable()
        {
            bool[] visited = new bool[t.Size * t.Size];
            bool   res     = true;
            int    rotate  = 1;

            SweapPiecePosition();
            bool      continu = true;
            Tetrimino tmp     = TetrisConsole.Model.Tetriminos.DeepCloner.Clone(t);

            while (continu && rotate < 4)
            {
                tmp.Rotate();
                FloodFill(tmp, tmp.pivot, tmp.colors, visited, ref res);
                rotate++;
                continu = !res;
            }
            PrintPiece();
            return(res);
        }