jrummikub.model
Class Hand

java.lang.Object
  extended by jrummikub.model.StoneTray<Stone>
      extended by jrummikub.model.Hand
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<Pair<Stone,Position>>, IHand, IStoneTray<Stone>

public class Hand
extends StoneTray<Stone>
implements IHand

Class managing a Player's Stones


Nested Class Summary
 
Nested classes/interfaces inherited from class jrummikub.model.StoneTray
StoneTray.Direction
 
Field Summary
static int HEIGHT
          The height of the hand
static int WIDTH
          The width of the hand
 
Fields inherited from class jrummikub.model.StoneTray
objects
 
Constructor Summary
Hand()
           
 
Method Summary
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
 
Methods inherited from class jrummikub.model.StoneTray
clone, 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, drop, getPosition, getSize, pickUp
 
Methods inherited from interface java.lang.Iterable
iterator
 

Field Detail

WIDTH

public static final int WIDTH
The width of the hand

See Also:
Constant Field Values

HEIGHT

public static final int HEIGHT
The height of the hand

See Also:
Constant Field Values
Constructor Detail

Hand

public Hand()
Method Detail

fixInvalidDrop

protected Pair<Position,StoneTray.Direction> fixInvalidDrop(Stone stone,
                                                            Position pos,
                                                            StoneTray.Direction dir)
Description copied from class: StoneTray
Checks whether the object may be placed on the given position, computes new position if not

Overrides:
fixInvalidDrop in class StoneTray<Stone>
Parameters:
stone - to be dropped
pos - the object is dropped at
Returns:
null if the drop is valid, new position otherwise