summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jrummikub/model/ITable.java11
-rw-r--r--src/jrummikub/model/Table.java12
-rw-r--r--src/jrummikub/view/impl/WinPanel.java2
3 files changed, 10 insertions, 15 deletions
diff --git a/src/jrummikub/model/ITable.java b/src/jrummikub/model/ITable.java
index 3b0032f..49db963 100644
--- a/src/jrummikub/model/ITable.java
+++ b/src/jrummikub/model/ITable.java
@@ -1,7 +1,5 @@
package jrummikub.model;
-import jrummikub.util.Pair;
-
/**
* Interface for the {@link Table} model
*/
@@ -11,10 +9,9 @@ public interface ITable extends IStoneTray<StoneSet> {
* Removes {@link Stone} from the Table
*
* @param stone
- * stone to pick up
- * @return the stone sets that are created by taking pickung the the stone
+ * stone to pick up
*/
- public Pair<StoneSet, StoneSet> pickUpStone(Stone stone);
+ public void pickUpStone(Stone stone);
/**
* Tests the Table for rule conflicts by checking all the {@link StoneSet}
@@ -25,7 +22,9 @@ public interface ITable extends IStoneTray<StoneSet> {
/**
* Finds the {@link StoneSet} containing the given {@link Stone}
- * @param stone stone whose set we're searching
+ *
+ * @param stone
+ * stone whose set we're searching
* @return the set containing the stone or null if no set was found
*/
StoneSet findStoneSet(Stone stone);
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} */
diff --git a/src/jrummikub/view/impl/WinPanel.java b/src/jrummikub/view/impl/WinPanel.java
index 8cfe458..07c3535 100644
--- a/src/jrummikub/view/impl/WinPanel.java
+++ b/src/jrummikub/view/impl/WinPanel.java
@@ -18,7 +18,7 @@ import jrummikub.util.IEvent;
* A panel that is displayed when a player has won
*/
@SuppressWarnings("serial")
-public class WinPanel extends JPanel {
+class WinPanel extends JPanel {
private final static int PANEL_INSET = 15;
private final static int PANEL_SEPARATOR = 10;
private final static float PANEL_FIRST_LINE_HEIGHT = 0.375f;