Remove return value of Table.pickUpStone()

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@229 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Matthias Schiffer 2011-05-10 16:53:44 +02:00
parent fa00c661d5
commit 85b5470c05
7 changed files with 20 additions and 21 deletions

View file

@ -15,7 +15,9 @@ public class MockPlayer implements IPlayer {
/** /**
* @param name * @param name
* the player name
* @param color * @param color
* the player color
*/ */
public MockPlayer(String name, Color color) { public MockPlayer(String name, Color color) {
hand = new MockHand(); hand = new MockHand();

View file

@ -22,9 +22,8 @@ public class MockTable implements ITable {
public List<Pair<StoneSet, Position>> sets = new ArrayList<Pair<StoneSet, Position>>(); public List<Pair<StoneSet, Position>> sets = new ArrayList<Pair<StoneSet, Position>>();
@Override @Override
public Pair<StoneSet, StoneSet> pickUpStone(Stone stone) { public void pickUpStone(Stone stone) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return null;
} }
@Override @Override

View file

@ -31,6 +31,7 @@ public class MockEvent1<T> implements IEvent1<T> {
/** /**
* @param value * @param value
* the event parameter
*/ */
public void emit(T value) { public void emit(T value) {
for (IListener1<T> listener : listeners) { for (IListener1<T> listener : listeners) {

View file

@ -33,7 +33,9 @@ public class MockEvent2<T1, T2> implements IEvent2<T1, T2> {
/** /**
* @param value1 * @param value1
* the first event parameter
* @param value2 * @param value2
* the second event parameter
*/ */
public void emit(T1 value1, T2 value2) { public void emit(T1 value1, T2 value2) {
for (IListener2<T1, T2> listener : listeners) { for (IListener2<T1, T2> listener : listeners) {

View file

@ -1,7 +1,5 @@
package jrummikub.model; package jrummikub.model;
import jrummikub.util.Pair;
/** /**
* Interface for the {@link Table} model * Interface for the {@link Table} model
*/ */
@ -12,9 +10,8 @@ public interface ITable extends IStoneTray<StoneSet> {
* *
* @param stone * @param stone
* stone to pick up * stone to pick up
* @return the stone sets that are created by taking pickung the the stone
*/ */
public Pair<StoneSet, StoneSet> pickUpStone(Stone stone); public void pickUpStone(Stone stone);
/** /**
* Tests the Table for rule conflicts by checking all the {@link StoneSet} * 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} * 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 * @return the set containing the stone or null if no set was found
*/ */
StoneSet findStoneSet(Stone stone); StoneSet findStoneSet(Stone stone);

View file

@ -25,14 +25,12 @@ public class Table extends StoneTray<StoneSet> implements ITable {
* stone to pick up * stone to pick up
*/ */
@Override @Override
public Pair<StoneSet, StoneSet> pickUpStone(Stone stone) { public void pickUpStone(Stone stone) {
StoneInfo info = findStoneInfo(stone); StoneInfo info = findStoneInfo(stone);
if (info == null) { if (info != null) {
return null; splitSet(info.set, info.setPosition, info.stonePosition);
} }
return splitSet(info.set, info.setPosition, info.stonePosition);
} }
private StoneInfo findStoneInfo(Stone stone) { private StoneInfo findStoneInfo(Stone stone) {
@ -71,7 +69,7 @@ public class Table extends StoneTray<StoneSet> implements ITable {
return info.set; return info.set;
} }
private Pair<StoneSet, StoneSet> splitSet(StoneSet set, Position setPosition, private void splitSet(StoneSet set, Position setPosition,
int stonePosition) { int stonePosition) {
pickUp(set); pickUp(set);
@ -101,8 +99,6 @@ public class Table extends StoneTray<StoneSet> implements ITable {
drop(leftSet.join(rightSet), newPosition); drop(leftSet.join(rightSet), newPosition);
} }
} }
return new Pair<StoneSet, StoneSet>(leftSet, rightSet);
} }
/** Tests the Table for rule conflicts by checking all the {@link StoneSet} */ /** Tests the Table for rule conflicts by checking all the {@link StoneSet} */

View file

@ -18,7 +18,7 @@ import jrummikub.util.IEvent;
* A panel that is displayed when a player has won * A panel that is displayed when a player has won
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class WinPanel extends JPanel { class WinPanel extends JPanel {
private final static int PANEL_INSET = 15; private final static int PANEL_INSET = 15;
private final static int PANEL_SEPARATOR = 10; private final static int PANEL_SEPARATOR = 10;
private final static float PANEL_FIRST_LINE_HEIGHT = 0.375f; private final static float PANEL_FIRST_LINE_HEIGHT = 0.375f;