Class BoggleBoardFactory

java.lang.Object
  extended by BoggleBoardFactory

public class BoggleBoardFactory
extends java.lang.Object

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

BoggleBoardFactory

public BoggleBoardFactory()
Method Detail

getBoard

public static BoggleBoard getBoard(int size)
Return a random board of specified size using the factory's BoardMaker.

Parameters:
size - specifies one dimension of square board returned
Returns:
board of the specified size

setMaker

public static void setMaker(IBoardMaker maker)
Change the board maker used by the factor.

Parameters:
maker - is new Boggle board maker

getRandom

public static java.util.Random getRandom()
Return the factory's random number generator, this helps ensure consist debugging or consistent play.

Returns:
the factory's Random source

setRandom

public static void setRandom(java.util.Random r)
Change the source of a game's random number generator.

Parameters:
r - is the new source of random values for a game