public class ClearCellGame extends Game
| Constructor and Description |
|---|
ClearCellGame(int maxRows,
int maxCols,
java.util.Random random,
int strategy)
Defines a board with empty cells.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getScore() |
boolean |
isGameOver()
The game is over when the last board row (row with index board.length -1)
is different from empty row.
|
void |
nextAnimationStep()
This method will attempt to insert a row of random BoardCell objects if
the last board row (row with index board.length -1) corresponds to the
empty row; otherwise no operation will take place.
|
void |
processCell(int rowIndex,
int colIndex)
This method will turn to BoardCell.EMPTY the cell selected and any
adjacent surrounding cells in the vertical, horizontal, and diagonal
directions that have the same color.
|
getBoardCell, getMaxCols, getMaxRows, setBoardCell, setBoardWithColor, setColWithColor, setRowWithColorpublic ClearCellGame(int maxRows,
int maxCols,
java.util.Random random,
int strategy)
maxRows - maxCols - random - strategy - public boolean isGameOver()
isGameOver in class Gamepublic void nextAnimationStep()
nextAnimationStep in class Gamepublic void processCell(int rowIndex,
int colIndex)
processCell in class Game