This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
JRummikub/src/jrummikub/model/IStoneTray.java

56 lines
1.2 KiB
Java
Raw Normal View History

package jrummikub.model;
import jrummikub.util.Pair;
/**
* Interface for the {@link StoneTray} model
*
* @param <E>
* Objects held by the IStoneTray
*/
public interface IStoneTray<E extends Sizeable> extends
Iterable<Pair<E, Position>>, Cloneable {
/**
* Adds object to the tray
*
* @param object
* object to add to Hand
* @param position
* {@link Position} to put the object
*/
public void drop(E object, Position position);
/**
* Returns the position of an object that is already on the tray
*
* @param object
* object whose position is requested
* @return position of the object or null when the object is not on the tray
*/
public Position getPosition(E object);
/**
* Tries to pick up (remove) a given object
*
* @param object
* object to pick up
* @return true when the object was successfully removed
*/
public boolean pickUp(E object);
/**
* Create a clone of the StoneTray
*
* @return cloned StoneTray
*/
public IStoneTray<E> clone();
/**
* Return the number of objects on the tray
*
* @return number of objects
*/
public int getSize();
}