diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-05-10 05:21:59 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-05-10 05:21:59 +0200 |
commit | 8f47c06e3175e7b2a6b0c27c96c0ed4d950b8ead (patch) | |
tree | edba1f85762b54fd08011d83b2ae37792d8061a9 /src/jrummikub/control | |
parent | 3eae312798019445758c23530344be8c71138f9b (diff) | |
download | JRummikub-8f47c06e3175e7b2a6b0c27c96c0ed4d950b8ead.tar JRummikub-8f47c06e3175e7b2a6b0c27c96c0ed4d950b8ead.zip |
Always collect on invalid range clicks
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@224 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r-- | src/jrummikub/control/TurnControl.java | 23 |
1 files changed, 11 insertions, 12 deletions
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<Connection> connections = new ArrayList<Connection>(); /** - * 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<Stone> setStones = new ArrayList<Stone>(); @@ -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<Pair<Stone, Position>> handPairs = new ArrayList<Pair<Stone, Position>>(); |