|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jrummikub.model.StoneTray<Stone> jrummikub.model.Hand
public class Hand
Class managing a Player
's Stone
s
Nested Class Summary |
---|
Nested classes/interfaces inherited from class jrummikub.model.StoneTray |
---|
StoneTray.Direction |
Field Summary | |
---|---|
private static java.util.Comparator<Pair<java.lang.Integer,StoneColor>> |
comparator
The measure to compare the stones by |
private static long |
serialVersionUID
|
static int |
WIDTH
The width of the hand |
Fields inherited from class jrummikub.model.StoneTray |
---|
objects |
Constructor Summary | |
---|---|
Hand()
|
Method Summary | |
---|---|
private static Pair<java.util.TreeMap<Pair<java.lang.Integer,StoneColor>,java.lang.Integer>,java.lang.Integer> |
countStones(java.util.List<Stone> stones)
Counts the numbers of stones |
protected Pair<Position,StoneTray.Direction> |
fixInvalidDrop(Stone stone,
Position pos,
StoneTray.Direction dir)
Checks whether the object may be placed on the given position, computes new position if not |
int |
getFreeRowSpace(int row)
Gets the amount of free space in a hand row |
int |
getIdenticalStoneCount()
Counts the pairs of identical stones |
int |
getRowCount()
The number of used rows |
int |
getStonePoints(GameSettings settings)
Get the accumulated number of points of stones in the hand |
private static void |
incrementStoneCount(java.util.TreeMap<Pair<java.lang.Integer,StoneColor>,java.lang.Integer> stones,
Pair<java.lang.Integer,StoneColor> stone)
Increments the count of a stone in the list of all stones |
boolean |
isInitialMeldPossible(GameSettings settings)
Tests whether it is possible to lay down an initial meld using the stones on the hand |
Methods inherited from class jrummikub.model.StoneTray |
---|
clone, contains, drop, getPosition, getSize, iterator, pickUp |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jrummikub.model.IStoneTray |
---|
clone, contains, drop, getPosition, getSize, pickUp |
Methods inherited from interface java.lang.Iterable |
---|
iterator |
Field Detail |
---|
private static final long serialVersionUID
public static final int WIDTH
private static final java.util.Comparator<Pair<java.lang.Integer,StoneColor>> comparator
Constructor Detail |
---|
public Hand()
Method Detail |
---|
public int getFreeRowSpace(int row)
IHand
getFreeRowSpace
in interface IHand
row
- the row number
public int getRowCount()
IHand
getRowCount
in interface IHand
protected Pair<Position,StoneTray.Direction> fixInvalidDrop(Stone stone, Position pos, StoneTray.Direction dir)
StoneTray
fixInvalidDrop
in class StoneTray<Stone>
stone
- to be droppedpos
- the object is dropped at
public int getStonePoints(GameSettings settings)
IHand
getStonePoints
in interface IHand
settings
- the game settings
public boolean isInitialMeldPossible(GameSettings settings)
IHand
isInitialMeldPossible
in interface IHand
settings
- the game settings
private static void incrementStoneCount(java.util.TreeMap<Pair<java.lang.Integer,StoneColor>,java.lang.Integer> stones, Pair<java.lang.Integer,StoneColor> stone)
stones
- all stones and their respective numbersstone
- the start stoneprivate static Pair<java.util.TreeMap<Pair<java.lang.Integer,StoneColor>,java.lang.Integer>,java.lang.Integer> countStones(java.util.List<Stone> stones)
stones
- the stones to count
public int getIdenticalStoneCount()
IHand
getIdenticalStoneCount
in interface IHand
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |