From b9fbe279c3d6e750f7c90ad0b244d315c9744bb2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 9 May 2011 00:33:31 +0200 Subject: Another fix for the Table pickUpStone method git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@179 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/Table.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/jrummikub/model') diff --git a/src/jrummikub/model/Table.java b/src/jrummikub/model/Table.java index 7787bea..df50bbf 100644 --- a/src/jrummikub/model/Table.java +++ b/src/jrummikub/model/Table.java @@ -27,7 +27,9 @@ public class Table extends StoneTray implements ITable { @Override public Pair pickUpStone(Stone stone) { StoneInfo info = findStoneInfo(stone); - + + System.err.println("Stone: " + stone); + if (info == null) { return null; } @@ -51,6 +53,7 @@ public class Table extends StoneTray implements ITable { } stonePosition++; } + set = null; } // Stone not found if (set == null) { @@ -73,10 +76,14 @@ public class Table extends StoneTray implements ITable { private Pair splitSet(StoneSet set, Position setPosition, int stonePosition) { pickUp(set); - + Pair firstSplit = set.splitAt(stonePosition); + System.err.println("Size: " + set.size()); + System.err.println("stonePosition: " + stonePosition); + System.err.println("Frist split: " + firstSplit.getFirst() + " " + firstSplit.getSecond()); Pair secondSplit = firstSplit.getSecond().splitAt(1); - + System.err.println("Second split: " + secondSplit.getFirst() + " " + secondSplit.getSecond()); + StoneSet leftSet = firstSplit.getFirst(); StoneSet rightSet = secondSplit.getSecond(); -- cgit v1.2.3