From 1e7cdb33f5bfce2d3fb174abd778788108557078 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Mon, 2 May 2011 04:46:00 +0200 Subject: More javadocs for the model git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@64 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/Stone.java | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'src/jrummikub/model/Stone.java') diff --git a/src/jrummikub/model/Stone.java b/src/jrummikub/model/Stone.java index 9721602..6c2fd54 100644 --- a/src/jrummikub/model/Stone.java +++ b/src/jrummikub/model/Stone.java @@ -7,37 +7,67 @@ public class Stone implements Sizeable { private StoneColor color; private final boolean joker; - public Stone(StoneColor color) { + /** + * 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; } - - public Stone(int value, StoneColor color) { + + /** + * Creates a normal stone of a given color and value + * + * @param value + * stone value + * @param color + * stone color + */ + public Stone(int value, StoneColor color) { this.value = value; this.color = color; this.joker = false; } - + + @Deprecated public Stone(int value, StoneColor color, boolean joker) { this.value = value; this.color = color; this.joker = joker; } + /** + * 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; -- cgit v1.2.3