package jrummikub.model;
/** Basic Rummikub Stone */
public class Stone implements Sizeable {
private int value;
private StoneColor color;
private final boolean joker;
/**
* Creates a joker of the given color. The color is only used for
* displaying.
*
* @param color
* joker color
*/
public Stone(StoneColor color) {
this.value = 0;
this.color = color;
this.joker = true;
}
* Creates a normal stone of a given color and value
* @param value
* stone value
* stone color
public Stone(int value, StoneColor color) {
this.value = value;
this.joker = false;
* Returns the color of the stone.
* @return stone color
public StoneColor getColor() {
return color;
* Returns whether the stone is a joker or not.
* @return true when the stone is a joker
public boolean isJoker() {
return joker;
* Returns the value of the stone. Don't use this value for jokers.
* @return stone value
public int getValue() {
return value;
@Override
public float getWidth() {
return 1;
public float getHeight() {