private MovableGrid(int outer_row, int outer_col, Tetromino inner, Board board) { this.inner = inner; this.board = board; this.row = outer_row; this.col = outer_col; }
public void Drop(Tetromino shape) { checkIfAlreadyFalling(); int row = StartingRowOffset(shape); fallingBlock = new MovableGrid(shape).MoveTo(row, Cols / 2 - shape.Columns() / 2); }
public void Drop(Tetromino shape) { CheckIsFalling(); int r = StartingRowOffset(shape); fallingBlock = new MovableGrid(shape).MoveTo(r, Columns / 2 - shape.Columns() / 2); }
public void Drop(Tetromino tetromino) { CheckIfFalling(); int row = StartingRowOffset(tetromino); MovableGrid mg = new MovableGrid(tetromino); this.fallingBlock = mg.MoveTo(row, (this.columns / 2) - (tetromino.Columns() / 2)); }
public static Tetromino CreateOshape() { Tetromino t = new Tetromino( ".OO.\n" + ".OO.\n" ); return(t); }
public Tetromino(Tetromino t) { rotations = new Piece[t.length]; for (int i = 0; i < t.length; i++) { rotations[i] = t.rotations[i]; } index_rotation = t.index_rotation; length = t.length; }
public Tetromino RotateLeft() { Tetromino newTetromino = new Tetromino(this); newTetromino.index_rotation--; if (newTetromino.index_rotation < 0) { newTetromino.index_rotation = length - 1; } return(newTetromino); }
public Tetromino RotateRight() { Tetromino newTetromino = new Tetromino(this); newTetromino.index_rotation++; if (newTetromino.index_rotation == length) { newTetromino.index_rotation = 0; } return(newTetromino); }
public Block(Tetromino grid) { this.rows = grid.Rows(); this.columns = grid.Columns(); this.block = new char[this.rows, this.columns]; for (int row = 0; row < this.rows; row++) { for (int col = 0; col < this.columns; col++) { this.block[row, col] = grid.cellule(row, col); } } }
public static Tetromino CreateZshape() { Tetromino t = new Tetromino( "....\n" + "ZZ..\n" + ".ZZ.\n" , "..Z.\n" + ".ZZ.\n" + ".Z..\n" ); return(t); }
public static Tetromino CreateSshape() { Tetromino s = new Tetromino( "....\n" + ".SS.\n" + "SS..\n" , "S...\n" + "SS..\n" + ".S..\n" ); return(s); }
public static Tetromino CreateIshape() { Tetromino t = new Tetromino( "....\n" + "IIII\n" + "....\n" + "....\n" , "..I.\n" + "..I.\n" + "..I.\n" + "..I.\n" ); return(t); }
public static Tetromino CreateLshape() { Tetromino t = new Tetromino( "....\n" + "LLL.\n" + "L...\n" , "LL..\n" + ".L..\n" + ".L..\n" , "....\n" + "..L.\n" + "LLL.\n" , ".L..\n" + ".L..\n" + ".LL.\n" ); return(t); }
public static Tetromino CreateJshape() { Tetromino t = new Tetromino( "....\n" + "JJJ.\n" + "..J.\n" , ".J..\n" + ".J..\n" + "JJ..\n" , "....\n" + "J...\n" + "JJJ.\n" , ".JJ.\n" + ".J..\n" + ".J..\n" ); return(t); }
public MovableGrid(Tetromino inner, Board board) : this(0, 0, inner, board) { }
private MovableGrid(int moverow, int movecol, Tetromino tetromino) { this.rows = moverow; this.columns = movecol; this.tetromino = tetromino; }
public MovableGrid(Tetromino tetromino) : this(0, 0, tetromino) { }
public MovableGrid(Tetromino tetromino) { this.Row = 0; this.Col = 0; this.tetromino = tetromino; }
public MovableGrid(Tetromino inner) : this(0, 0, inner) { }
private MovableGrid(Tetromino tetromino, int row, int col) { this.Row = row; this.Col = col; this.tetromino = tetromino; }
public MovableGrid(Tetromino tetromino) { Representation = tetromino; }
private MovableGrid(int outer_row, int outer_col, Tetromino inner) { this.row = outer_row; this.col = outer_col; this.inner = inner; }
public MovableGrid(Tetromino tetromino, int x, int y) { Representation = tetromino; X = x; Y = y; }