|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cb.cardboard.AbstractCardBoardModel org.cb.jset.client.model.JSetClientBoardModel
A client BoardImpl is a special board that also keeps track of card layout, especially the empty spaces. Note: implementation not yet multithread safe (FIXME)
Constructor Summary | |
JSetClientBoardModel()
|
Method Summary | |
void |
addCards(CardProperties[] cards)
Add the specified cards onto the board. |
void |
clear()
Clear the board. |
Card |
getElementAt(int index)
Return the Card element specified by the index on the board. |
java.util.List |
getElements()
|
int |
getNbCards()
|
int |
getSize()
Returns the number of cards on the board. |
void |
removeSet(CardSet set)
Remove the specified matching set from the board. |
Methods inherited from class org.cb.cardboard.AbstractCardBoardModel |
addBoardDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, removeBoardDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JSetClientBoardModel()
Method Detail |
public void clear()
public int getSize()
CardBoardModel
getSize
in interface CardBoardModel
for the exact number of cards on the board.
public Card getElementAt(int index)
getElementAt
in interface CardBoardModel
index
-
null
if the space on the board is empty at that position.public java.util.List getElements()
getElements
in interface CardBoardModel
null
to represent the empty spaces.public int getNbCards()
getNbCards
in interface SetGameClientBoard
which takes into account the number of cards plus the empty spaces.
public void addCards(CardProperties[] cards)
addCards
in interface SetGameClientBoard
cards
- the cards to add.
java.lang.NullPointerException
- if cards
is null
or if an element in the array is null
.public void removeSet(CardSet set) throws BoardException
removeSet
in interface SetGameClientBoard
set
- the set to remove
BoardException
- when something fails
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |