summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model/Hand.java
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-06-21 15:23:27 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-06-21 15:23:27 +0200
commite4e66240bf864354715f3812f70444d7f7511dd2 (patch)
treefd413618a6f4b37ccb3ac66ed4d6d7eecd040c57 /src/jrummikub/model/Hand.java
parent5e3ce21569f5adc92c969735c88af488cf581916 (diff)
downloadJRummikub-e4e66240bf864354715f3812f70444d7f7511dd2.tar
JRummikub-e4e66240bf864354715f3812f70444d7f7511dd2.zip
model vollständig dukumentiert
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@546 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/model/Hand.java')
-rw-r--r--src/jrummikub/model/Hand.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/jrummikub/model/Hand.java b/src/jrummikub/model/Hand.java
index 3e6bfeb..1388187 100644
--- a/src/jrummikub/model/Hand.java
+++ b/src/jrummikub/model/Hand.java
@@ -47,8 +47,8 @@ public class Hand extends StoneTray<Stone> implements IHand {
}
@Override
- protected Pair<Position, Direction> fixInvalidDrop(Stone stone, Position pos,
- Direction dir) {
+ protected Pair<Position, Direction> fixInvalidDrop(Stone stone,
+ Position pos, Direction dir) {
double x = pos.getX();
double y = pos.getY();
@@ -59,9 +59,11 @@ public class Hand extends StoneTray<Stone> implements IHand {
return new Pair<Position, Direction>(new Position(0, y), RIGHT);
} else {
if (getFreeRowSpace((int) y) == 0) {
- return new Pair<Position, Direction>(new Position(0, y + 1), RIGHT);
+ return new Pair<Position, Direction>(new Position(0, y + 1),
+ RIGHT);
} else {
- return new Pair<Position, Direction>(new Position(WIDTH - 1, y), LEFT);
+ return new Pair<Position, Direction>(
+ new Position(WIDTH - 1, y), LEFT);
}
}
}
@@ -99,8 +101,9 @@ public class Hand extends StoneTray<Stone> implements IHand {
* Increments the count of a stone in the list of all stones
*
* @param stones
- * all stones and their respective numbers
+ * all stones and their respective numbers
* @param stone
+ * the start stone
*/
private static void incrementStoneCount(
TreeMap<Pair<Integer, StoneColor>, Integer> stones,
@@ -132,7 +135,7 @@ public class Hand extends StoneTray<Stone> implements IHand {
* Counts the numbers of stones
*
* @param stones
- * the stones to count
+ * the stones to count
* @return the numbers for all stones
*/
private static Pair<TreeMap<Pair<Integer, StoneColor>, Integer>, Integer> countStones(
@@ -159,7 +162,8 @@ public class Hand extends StoneTray<Stone> implements IHand {
public int getIdenticalStoneCount() {
List<Stone> stones = new ArrayList<Stone>();
- for (Iterator<Pair<Stone, Position>> iter = this.iterator(); iter.hasNext();) {
+ for (Iterator<Pair<Stone, Position>> iter = this.iterator(); iter
+ .hasNext();) {
stones.add(iter.next().getFirst());
}