summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model/Table.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/model/Table.java')
-rw-r--r--src/jrummikub/model/Table.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/jrummikub/model/Table.java b/src/jrummikub/model/Table.java
index 4c84193..f134975 100644
--- a/src/jrummikub/model/Table.java
+++ b/src/jrummikub/model/Table.java
@@ -25,14 +25,12 @@ public class Table extends StoneTray<StoneSet> implements ITable {
* stone to pick up
*/
@Override
- public Pair<StoneSet, StoneSet> pickUpStone(Stone stone) {
+ public void pickUpStone(Stone stone) {
StoneInfo info = findStoneInfo(stone);
- if (info == null) {
- return null;
+ if (info != null) {
+ splitSet(info.set, info.setPosition, info.stonePosition);
}
-
- return splitSet(info.set, info.setPosition, info.stonePosition);
}
private StoneInfo findStoneInfo(Stone stone) {
@@ -71,7 +69,7 @@ public class Table extends StoneTray<StoneSet> implements ITable {
return info.set;
}
- private Pair<StoneSet, StoneSet> splitSet(StoneSet set, Position setPosition,
+ private void splitSet(StoneSet set, Position setPosition,
int stonePosition) {
pickUp(set);
@@ -101,8 +99,6 @@ public class Table extends StoneTray<StoneSet> implements ITable {
drop(leftSet.join(rightSet), newPosition);
}
}
-
- return new Pair<StoneSet, StoneSet>(leftSet, rightSet);
}
/** Tests the Table for rule conflicts by checking all the {@link StoneSet} */