Class BingoCard

java.lang.Object
  extended by edu.kzoo.grid.Grid
      extended by edu.kzoo.grid.BoundedGrid
          extended by BingoCard

public class BingoCard
extends edu.kzoo.grid.BoundedGrid

Bingo Game:
A BingoCard object represents a card with random numbers (but no duplicates) that can be used for a game of bingo.

Version:
Mar 18, 2008
Author:
Kelly Schultz and Alyce Brady

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.kzoo.grid.BoundedGrid
edu.kzoo.grid.BoundedGrid.Array2DGridRep
 
Nested classes/interfaces inherited from class edu.kzoo.grid.Grid
edu.kzoo.grid.Grid.BoundedGridValidityChecker, edu.kzoo.grid.Grid.InternalRepresentation, edu.kzoo.grid.Grid.UnboundedGridValidityChecker, edu.kzoo.grid.Grid.ValidityChecker
 
Field Summary
 
Fields inherited from class edu.kzoo.grid.Grid
includeDiagonals, internalRep, UNBOUNDED
 
Constructor Summary
BingoCard(int max_value)
          Constructs a new BingoCard object containing numbers in the range of 1 -- max_value.
 
Method Summary
 BingoValueCell getCellAt(int row, int col)
          Returns the cell at the given (row, col) location, or null if there is no Bingo value cell there.
 void indicateCardWon()
          Indicates this card won by setting the column headings to the highlight color used to mark numbers.
 void initialize()
          Set up (or reset) the card with column headings and random Bingo values.
 void playNumber(int numToPlay)
          If this bingo card contains numToPlay, marks it as found.
 
Methods inherited from class edu.kzoo.grid.BoundedGrid
numCols, numRows
 
Methods inherited from class edu.kzoo.grid.Grid
add, allObjects, getDirection, getNeighbor, isEmpty, isValid, neighborsOf, numAdjacentNeighbors, numObjects, objectAt, randomDirection, remove, remove, removeAll, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BingoCard

public BingoCard(int max_value)
Constructs a new BingoCard object containing numbers in the range of 1 -- max_value.

Method Detail

getCellAt

public BingoValueCell getCellAt(int row,
                                int col)
Returns the cell at the given (row, col) location, or null if there is no Bingo value cell there.


indicateCardWon

public void indicateCardWon()
Indicates this card won by setting the column headings to the highlight color used to mark numbers. Assumes that the highlight color is different from the initial column heading color.


initialize

public void initialize()
Set up (or reset) the card with column headings and random Bingo values.


playNumber

public void playNumber(int numToPlay)
If this bingo card contains numToPlay, marks it as found.

Parameters:
numToPlay - the number to play (mark if found)