|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jrummikub.model.StoneHeap
public class StoneHeap
StoneHeap creates all Stone
s for a game, manages them and allows
players to draw one or more random Stones.
Field Summary | |
---|---|
(package private) java.util.List<Stone> |
heap
|
Constructor Summary | |
---|---|
StoneHeap()
Creates 106 Stones according to standard rules |
Method Summary | |
---|---|
Stone |
drawStone()
Removes random Stone from the heap and returns it |
java.util.List<Stone> |
drawStones(int number)
Removes several Stone s from the heap and returns them |
int |
getSize()
Get the number of stones left |
void |
putBack(java.util.Collection<Stone> stones)
Put stones back on the heap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.List<Stone> heap
Constructor Detail |
---|
public StoneHeap()
Method Detail |
---|
public Stone drawStone()
Stone
from the heap and returns it
public java.util.List<Stone> drawStones(int number)
Stone
s from the heap and returns them
number
- number of requested Stones
public int getSize()
public void putBack(java.util.Collection<Stone> stones)
stones
- collection of stones to put back
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |