All Packages Class Hierarchy This Package Previous Next Index
Class scrobble.Board
java.lang.Object
|
+----scrobble.Board
- public class Board
- extends Object
The Board
class represents the board used in the
Scrabble game. It is configured from a BoardShape
object. It is made up of squares and implements the main methods
to verify and to put the words on the board
-
shape
- Shape of the Board
-
squares
- Matrix of Squares
-
Board(BoardShape)
- Creates a new Board with the given shape
-
dump()
- Dumps the board to the console
-
empty()
- Empties the board
-
getLetters()
- Returns the list of letters on the board
-
getShape()
- Return the shape of the board
-
getWords()
- Returns the list of words on the board
-
main(String[])
-
-
putWord(WordPositioner)
- Puts the word on the board
-
receive()
- Receive from the Net
-
transmit()
- Transmits over the Net
-
tryAndFit(WordPositioner)
- Tries to fit a word to the board according to the given position
shape
BoardShape shape
- Shape of the Board
squares
Square squares[][]
- Matrix of Squares
Board
public Board(BoardShape shape)
- Creates a new Board with the given shape
- Parameters:
- shape - the shape of the new board created
getShape
public BoardShape getShape()
- Return the shape of the board
- Returns:
- the shape
getWords
public Vector getWords()
- Returns the list of words on the board
- Returns:
- the Vector of words
getLetters
public Vector getLetters()
- Returns the list of letters on the board
- Returns:
- the Vector of letters
empty
public void empty()
- Empties the board
tryAndFit
Vector tryAndFit(WordPositioner wordp) throws IllegalPositionException
- Tries to fit a word to the board according to the given position
- Parameters:
- wordp - the WordPositioner containing the word and the position of the word
- Returns:
- the list of the resulting words on the board.
- Throws: IllegalPositionException
- if it was impossible to fit the given word to the board according to the given position.
putWord
public void putWord(WordPositioner wordp)
- Puts the word on the board
- Parameters:
- wordp - the WordPositioner containing the word and the position of the word
transmit
public void transmit()
- Transmits over the Net
receive
public void receive()
- Receive from the Net
dump
public void dump()
- Dumps the board to the console
main
public static void main(String args[])
All Packages Class Hierarchy This Package Previous Next Index