jrummikub.model
Interface IHand

All Superinterfaces:
java.lang.Cloneable, IStoneTray<Stone>, java.lang.Iterable<Pair<Stone,Position>>, java.io.Serializable
All Known Implementing Classes:
Hand

public interface IHand
extends IStoneTray<Stone>

Interface for the Hand model


Method Summary
 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
 boolean isInitialMeldPossible(GameSettings settings)
          Tests whether it is possible to lay down an initial meld using the stones on the hand
 
Methods inherited from interface jrummikub.model.IStoneTray
clone, contains, drop, getPosition, getSize, pickUp
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

getRowCount

int getRowCount()
The number of used rows

Returns:
the number of rows

getFreeRowSpace

int getFreeRowSpace(int row)
Gets the amount of free space in a hand row

Parameters:
row - the row number
Returns:
the number of stones that can fit into the row

getStonePoints

int getStonePoints(GameSettings settings)
Get the accumulated number of points of stones in the hand

Parameters:
settings - the game settings
Returns:
points

isInitialMeldPossible

boolean isInitialMeldPossible(GameSettings settings)
Tests whether it is possible to lay down an initial meld using the stones on the hand

Parameters:
settings - the game settings
Returns:
true if an initial meld is possible

getIdenticalStoneCount

int getIdenticalStoneCount()
Counts the pairs of identical stones

Returns:
number of identical stone pairs