summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model/Stone.java
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-02 04:46:00 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-02 04:46:00 +0200
commit1e7cdb33f5bfce2d3fb174abd778788108557078 (patch)
tree7ef56ce60b813402eabff2bc1aee77ba6142cbd8 /src/jrummikub/model/Stone.java
parent91b921248f4a74bddd8434bcad65c45fd8486549 (diff)
downloadJRummikub-1e7cdb33f5bfce2d3fb174abd778788108557078.tar
JRummikub-1e7cdb33f5bfce2d3fb174abd778788108557078.zip
More javadocs for the model
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@64 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/model/Stone.java')
-rw-r--r--src/jrummikub/model/Stone.java40
1 files changed, 35 insertions, 5 deletions
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;