From 8f47c06e3175e7b2a6b0c27c96c0ed4d950b8ead Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 10 May 2011 05:21:59 +0200 Subject: Always collect on invalid range clicks git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@224 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/TurnControl.java | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/jrummikub/control') diff --git a/src/jrummikub/control/TurnControl.java b/src/jrummikub/control/TurnControl.java index d280096..afe1f9a 100644 --- a/src/jrummikub/control/TurnControl.java +++ b/src/jrummikub/control/TurnControl.java @@ -36,15 +36,15 @@ public class TurnControl { private List connections = new ArrayList(); /** - * Create a new TurnControl using a given hand (of the active player), a - * given table and a given view for user interaction. + * Create a new TurnControl using a given hand (of the active player), a given + * table and a given view for user interaction. * * @param hand - * active player's hand + * active player's hand * @param table - * current table + * current table * @param view - * view for user interaction. + * view for user interaction. */ public TurnControl(IHand hand, ITable table, IView view) { this.hand = hand; @@ -247,9 +247,8 @@ public class TurnControl { y++; if (y >= GameControl.HAND_HEIGHT) { - throw new ArrayIndexOutOfBoundsException(); // TODO We can't - // handle - // this yet... + // TODO We can't handle this yet... + throw new ArrayIndexOutOfBoundsException(); } } } @@ -329,14 +328,14 @@ public class TurnControl { private void tableRangeClick(Stone stone, Boolean collect) { if (selectedStones.isEmpty()) { - stoneClick(stone, collect); + stoneClick(stone, true); return; } Stone lastStone = selectedStones.get(selectedStones.size() - 1); StoneSet lastSet = table.findStoneSet(lastStone); StoneSet selectedSet = table.findStoneSet(stone); if (lastSet != selectedSet) { - stoneClick(stone, collect); + stoneClick(stone, true); return; } List setStones = new ArrayList(); @@ -361,13 +360,13 @@ public class TurnControl { private void handRangeClick(Stone stone, Boolean collect) { if (selectedStones.isEmpty()) { - stoneClick(stone, collect); + stoneClick(stone, true); return; } Stone lastStone = selectedStones.get(selectedStones.size() - 1); StoneSet lastSet = table.findStoneSet(lastStone); if (lastSet != null) { - stoneClick(stone, collect); + stoneClick(stone, true); return; } List> handPairs = new ArrayList>(); -- cgit v1.2.3