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


Variable Index

 o shape
Shape of the Board
 o squares
Matrix of Squares

Constructor Index

 o Board(BoardShape)
Creates a new Board with the given shape

Method Index

 o dump()
Dumps the board to the console
 o empty()
Empties the board
 o getLetters()
Returns the list of letters on the board
 o getShape()
Return the shape of the board
 o getWords()
Returns the list of words on the board
 o main(String[])
 o putWord(WordPositioner)
Puts the word on the board
 o receive()
Receive from the Net
 o transmit()
Transmits over the Net
 o tryAndFit(WordPositioner)
Tries to fit a word to the board according to the given position

Variables

 o shape
 BoardShape shape
Shape of the Board

 o squares
 Square squares[][]
Matrix of Squares

Constructors

 o Board
 public Board(BoardShape shape)
Creates a new Board with the given shape

Parameters:
shape - the shape of the new board created

Methods

 o getShape
 public BoardShape getShape()
Return the shape of the board

Returns:
the shape
 o getWords
 public Vector getWords()
Returns the list of words on the board

Returns:
the Vector of words
 o getLetters
 public Vector getLetters()
Returns the list of letters on the board

Returns:
the Vector of letters
 o empty
 public void empty()
Empties the board

 o 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.
 o 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
 o transmit
 public void transmit()
Transmits over the Net

 o receive
 public void receive()
Receive from the Net

 o dump
 public void dump()
Dumps the board to the console

 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index