|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface provides the methods needed for the Boggle Model, that is,
methods to manipulate the board data, score data and dictionary model.
The constructor of BoggleModel must take exactly these four parameters:
a String specifying the board file to be loaded initially (may be null).
a String specifying the dictionary file to be loaded (may be null).
an int which specifies how many rows the board should be (>=4).
an int which specifies how many cols the board be (>=4). *
IMPORTANT NOTE #2 :
You must define these two public static fields to specify the author and a brief description.
as follows:
public static final String author = " ... ";
public static final String description = " ... ";
"authors" should identify the authors in some fashion, but pseudonyms or
nicknames are acceptable. "description" should give a brief description
of the module, especially if there are any unexpected or unique features
about it. The information in both fields may be visible to the general
public, indefinitely into the future, so do not place any information here
which you do not wish to be publicly available.
Method Summary | |
int |
addScore(int scoreAugment)
Add to the score. |
boolean |
createBoard(String fileID)
create a new board by loading from a resource (file) if fileID is null, the board is created internally (for example, it randomly assigns the characters for each cell). |
int |
getCols()
Tells the number of columns of the board. |
int |
getLetter(int row,
int col)
Retrive the character on the cell specified by col and row. |
int |
getRows()
Tells the number of rows of the board |
int |
getScore()
Tell the current score. |
IBoggleWordsModel |
getWordsModel()
make the words model object visible to controller |
void |
resetScore()
Reset the score to zero; for example, at the start of another game. |
void |
terminate()
Perform cleanup when the application is about to end. |
Method Detail |
public boolean createBoard(String fileID)
fileID
- a String specifies the resource (file) of a designed board;
or null if an internally generated board should be produced.
public int getLetter(int row, int col)
col
- the column in the boardrow
- the row in the board
public int getCols()
public int getRows()
public int addScore(int scoreAugment)
scoreAugment
- >=0, the value to be added to the total score.
public int getScore()
public void resetScore()
public IBoggleWordsModel getWordsModel()
public void terminate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |