|
||||||||||
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 | |
---|---|
private java.util.Random |
generator
|
(package private) java.util.ArrayList<Stone> |
heap
|
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
StoneHeap(GameSettings gameSettings)
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 |
---|
private static final long serialVersionUID
java.util.ArrayList<Stone> heap
private java.util.Random generator
Constructor Detail |
---|
public StoneHeap(GameSettings gameSettings)
gameSettings
- (for number of sets/jokers, colors etc.)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 |