|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectBoard
public class Board
| Constructor Summary | |
|---|---|
Board()
|
|
Board(java.lang.String boardfile)
|
|
| Method Summary | |
|---|---|
int |
addTile(Tile letter,
int row,
int col)
Adds a letter to the board, returns -1 if unsuccessful Otherwise, it adds the letter and returns the amount of points gained. |
int |
calculatePoints(java.util.ArrayList<Square> pieces)
Takes in a ArrayList |
int |
calculatePoints(int row,
int col)
Calculates the amount of points gained by the recent placement of the piece at [row, col]. |
boolean |
checkWord(Word word)
Checks whether the word passed in exists in the dictionary |
Square[][] |
getBoard()
|
Word |
getHorizontalWord(int row,
int col)
Returns a Word, the horizontal word begining at [row,col] |
java.util.ArrayList<Square> |
getHorizontalWordSquares(int row,
int col)
Returns the list of squares making up the word beginning at row, col [word] |
int[] |
getHorizontalWordStart(int row,
int col)
Returns [x,y] point of the start of a word, [-1,-1] if invalid |
Word |
getVerticalWord(int row,
int col)
Returns a ArrayList |
java.util.ArrayList<Square> |
getVerticalWordSquares(int row,
int col)
Returns the list of squares making up the word beginning at row, col [vertical] |
int[] |
getVerticalWordStart(int row,
int col)
Returns [x,y] point of the start of a word, [-1,-1] if invalid |
void |
init()
|
protected void |
makeBoard()
Reads the board from a file and inits the board attribute. |
void |
setBoard(Square[][] board)
|
java.lang.String |
toString()
|
static java.util.ArrayList<java.lang.String> |
WordsExist(java.util.ArrayList<java.lang.String> words)
Checks to see if any of the words in the list are actual words. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Board()
public Board(java.lang.String boardfile)
| Method Detail |
|---|
public void init()
protected void makeBoard()
throws java.io.FileNotFoundException
java.io.FileNotFoundException
public int addTile(Tile letter,
int row,
int col)
public static java.util.ArrayList<java.lang.String> WordsExist(java.util.ArrayList<java.lang.String> words)
public int calculatePoints(java.util.ArrayList<Square> pieces)
pieces -
public int calculatePoints(int row,
int col)
public int[] getHorizontalWordStart(int row,
int col)
row - col -
public int[] getVerticalWordStart(int row,
int col)
row - col -
public Word getHorizontalWord(int row,
int col)
row - col -
public java.util.ArrayList<Square> getHorizontalWordSquares(int row,
int col)
row - the starting rowcol - the ending column
public java.util.ArrayList<Square> getVerticalWordSquares(int row,
int col)
row - the starting rowcol - the ending column
public Word getVerticalWord(int row,
int col)
row - col -
public void setBoard(Square[][] board)
public Square[][] getBoard()
public boolean checkWord(Word word)
word - the word to check
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||