|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodel.GameModel
public abstract class GameModel
This class represents the logic of a game where a board is updated on each step of the game animation. The board can also be updated by selecting a board cell.
| Constructor Summary | |
|---|---|
GameModel(int maxRows,
int maxCols)
Defines a board with BoardCell.EMPTY cells. |
|
| Method Summary | |
|---|---|
BoardCell |
getBoardCell(int rowIndex,
int colIndex)
|
int |
getMaxCols()
|
int |
getMaxRows()
|
abstract int |
getScore()
|
abstract boolean |
isGameOver()
|
abstract void |
nextAnimationStep()
Advances the animation one step. |
abstract void |
processCell(int rowIndex,
int colIndex)
Adjust the board state according to the current board state and the selected cell. |
void |
setBoardCell(int rowIndex,
int colIndex,
BoardCell boardCell)
|
java.lang.String |
toString()
Provides a string representation of the board We have implemented this method for you. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GameModel(int maxRows,
int maxCols)
maxRows - maxCols - | Method Detail |
|---|
public int getMaxRows()
public int getMaxCols()
public void setBoardCell(int rowIndex,
int colIndex,
BoardCell boardCell)
public BoardCell getBoardCell(int rowIndex,
int colIndex)
public java.lang.String toString()
toString in class java.lang.Objectpublic abstract boolean isGameOver()
public abstract int getScore()
public abstract void nextAnimationStep()
public abstract void processCell(int rowIndex,
int colIndex)
rowIndex - colIndex -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||