org.cb.jset
Class BoardImpl

java.lang.Object
  extended byorg.cb.jset.BoardImpl
All Implemented Interfaces:
org.cb.jset.SetGameBoard

public class BoardImpl
extends java.lang.Object
implements org.cb.jset.SetGameBoard

An implementation of a set game board.

Version:
$Id: BoardImpl.java 129 2004-04-15 05:00:43Z jerome $
Author:
jerome@coffeebreaks.org - last modified by $LastChangedBy: jerome $

Constructor Summary
BoardImpl()
           
 
Method Summary
 void addBoardListener(SetGameBoardListener boardListener)
          Adds a boardListener to this board.
 void addCards(CardProperties[] cards)
          Add the specified cards onto the board.
 CardProperties[] getCards()
           
 int getNbCards()
           
 void matchSet(CardSet set)
          Tries to match the specified set on this board.
 void removeBoardListener(SetGameBoardListener boardListener)
          Removes a listener from this board.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoardImpl

public BoardImpl()
Method Detail

getCards

public CardProperties[] getCards()
Specified by:
getCards in interface org.cb.jset.SetGameBoard
Returns:
the cards on the board.

addBoardListener

public void addBoardListener(SetGameBoardListener boardListener)
Adds a boardListener to this board. Does nothing if null is passed as argument.

Specified by:
addBoardListener in interface org.cb.jset.SetGameBoard
Parameters:
boardListener - the boardListener to add

removeBoardListener

public void removeBoardListener(SetGameBoardListener boardListener)
Removes a listener from this board. Does nothing if null is passed as argument.

Specified by:
removeBoardListener in interface org.cb.jset.SetGameBoard
Parameters:
boardListener - the listener to remove

addCards

public void addCards(CardProperties[] cards)
Add the specified cards onto the board.

Specified by:
addCards in interface org.cb.jset.SetGameBoard
Parameters:
cards - a non-null array, containing non-null elements.

getNbCards

public int getNbCards()
Specified by:
getNbCards in interface org.cb.jset.SetGameBoard
Returns:
the number of cards on the board.

matchSet

public void matchSet(CardSet set)
              throws MatchingException,
                     BoardException
Tries to match the specified set on this board.

Specified by:
matchSet in interface org.cb.jset.SetGameBoard
Parameters:
set - the set to remove
Throws:
MatchingException - if the specified set is not matching
BoardException - if one of the set card is not on the board.


Copyright © 2004 CoffeeBreaks. All Rights Reserved.