Esempio n. 1
0
 private void rotate() {
   final Coordinate c = randomNormal();
   final Piece piece = pieces[c.getY()][c.getX()];
   if (piece.getType() == PieceType.NORMAL) {
     piece.rotate((int) GaUtil.random(1, 3));
   }
 }
Esempio n. 2
0
  private void rotateBorder(final Piece piece, final Direction... directions) {
    if (borderSum(piece, directions) == 0) {
      return;
    }

    for (int i = 0; i < 3; i++) {
      piece.rotate(1);
      if (borderSum(piece, directions) == 0) {
        return;
      }
    }
    throw new IllegalStateException("NO BORDER OR CORNER!!");
  }
Esempio n. 3
0
 public void Rotate() {
   grid = current.rotate(grid);
   repaint();
 }