|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object BoggleBoardFactory
public class BoggleBoardFactory
Factory for generating boggle boards. The current
implementation uses StandardBoardMaker
which has standard Boggle and Big Boggle cubes for 4x4
and 5x5 boards, respectively. The board generator/maker can
be changed via setMaker
.
The factory is also the source for a game's random-number
generator. This facilitates consistent debugging, e.g.,
the default random number generator uses a set seed
so that the same sequence of games results every time
since the source of randomness is specified. This can
be altered via setRandom
.
Constructor Summary | |
---|---|
BoggleBoardFactory()
|
Method Summary | |
---|---|
static BoggleBoard |
getBoard(int size)
Return a random board of specified size using the factory's BoardMaker. |
static java.util.Random |
getRandom()
Return the factory's random number generator, this helps ensure consist debugging or consistent play. |
static void |
setMaker(IBoardMaker maker)
Change the board maker used by the factor. |
static void |
setRandom(java.util.Random r)
Change the source of a game's random number generator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BoggleBoardFactory()
Method Detail |
---|
public static BoggleBoard getBoard(int size)
size
- specifies one dimension of square board
returned
public static void setMaker(IBoardMaker maker)
maker
- is new Boggle board makerpublic static java.util.Random getRandom()
public static void setRandom(java.util.Random r)
r
- is the new source of random values for a game
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |