@Test public void testGetValue() { board.placeTetromino(Tetromino.S, 0, 0); Assert.assertEquals(1, board.getValue(BoardUtils.toMarginPos(TetrisBoard.DEFAULT_BOARD_SIZE, 18, 1))); Assert.assertEquals(0, board.getValue(BoardUtils.toMarginPos(TetrisBoard.DEFAULT_BOARD_SIZE, 18, 3))); Assert.assertEquals(1, board.getValue(BoardUtils.toMarginPos(TetrisBoard.DEFAULT_BOARD_SIZE, 19, 0))); Assert.assertEquals(1, board.getValue(BoardUtils.toMarginPos(TetrisBoard.DEFAULT_BOARD_SIZE, 19, 1))); Assert.assertEquals(0, board.getValue(BoardUtils.toMarginPos(TetrisBoard.DEFAULT_BOARD_SIZE, 18, 0))); }
@Override public int getValue(int row, int col) { return buf[toPos(row, col)]; }
TetrisBoard implements Board { @Override public int getValue(int row, int col) { return buf[toPos(row, col)]; } }
TetrisBoard implements Board { @Override public int getValue(int row, int col) { return buf[toPos(row, col)]; } TetrisBoard(); private  TetrisBoard(TetrisBoard board); }
TetrisBoard implements Board { @Override public int getValue(int row, int col) { return buf[toPos(row, col)]; } TetrisBoard(); private  TetrisBoard(TetrisBoard board); RectSize getSize(); int getMaxColumnHeight(); int[] getSkyline(); boolean isHeightExceeded(); @Override int getWidth(); @Override int getHeight(); @Override int getValue(int row, int col); @Override void setValue(int row, int col, int color); @Override int getValue(int pos); @Override void setValue(int pos, int color); @Override void invert(); @Override Board createAfterState(int row, int col, int player); @Override TetrisBoard clone(); IntArrayList placeTetromino(Tetromino tetromino, int column, int rotation); IntArrayList placeTetrominoCustom(Tetromino tetromino, int column, int rotation, int piece); Pair<IntArrayList, Integer> simulatePlaceTetrominoNaive(Tetromino tetromino, int column, int rotation); SimulationResult simulatePlaceTetromino(Tetromino tetromino, int column, int rotation); IntSortedSet eraseCompleteLines(IntArrayList changedPositions); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); int getHolesCount(); }
TetrisBoard implements Board { @Override public int getValue(int row, int col) { return buf[toPos(row, col)]; } TetrisBoard(); private  TetrisBoard(TetrisBoard board); RectSize getSize(); int getMaxColumnHeight(); int[] getSkyline(); boolean isHeightExceeded(); @Override int getWidth(); @Override int getHeight(); @Override int getValue(int row, int col); @Override void setValue(int row, int col, int color); @Override int getValue(int pos); @Override void setValue(int pos, int color); @Override void invert(); @Override Board createAfterState(int row, int col, int player); @Override TetrisBoard clone(); IntArrayList placeTetromino(Tetromino tetromino, int column, int rotation); IntArrayList placeTetrominoCustom(Tetromino tetromino, int column, int rotation, int piece); Pair<IntArrayList, Integer> simulatePlaceTetrominoNaive(Tetromino tetromino, int column, int rotation); SimulationResult simulatePlaceTetromino(Tetromino tetromino, int column, int rotation); IntSortedSet eraseCompleteLines(IntArrayList changedPositions); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); int getHolesCount(); static final int EMPTY; static final int PIECE; static final int NUM_VALUES; static final int MARGIN_WIDTH; static final int BOARD_WIDTH; static final int BOARD_HEIGHT; static final int WIDTH; static final int HEIGHT; static final RectSize DEFAULT_BOARD_SIZE; }