diff options
Diffstat (limited to 'src/jrummikub/control/turn/HumanTurnControl.java')
-rw-r--r-- | src/jrummikub/control/turn/HumanTurnControl.java | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/jrummikub/control/turn/HumanTurnControl.java b/src/jrummikub/control/turn/HumanTurnControl.java index 02541d2..2ab7b21 100644 --- a/src/jrummikub/control/turn/HumanTurnControl.java +++ b/src/jrummikub/control/turn/HumanTurnControl.java @@ -48,7 +48,7 @@ public class HumanTurnControl extends AbstractTurnControl { HumanTurnControl(ITurnTimer testTimer) { this.timer = testTimer; } - + protected void timeOut() { endOfTurn(false); } @@ -97,13 +97,12 @@ public class HumanTurnControl extends AbstractTurnControl { } })); - connections.add(view.getPlayerPanel().getRedealEvent() - .add(new IListener() { - @Override - public void handle() { - endOfTurn(true); - } - })); + connections.add(view.getPlayerPanel().getRedealEvent().add(new IListener() { + @Override + public void handle() { + endOfTurn(true); + } + })); } private void addHandPanelHandlers() { @@ -304,8 +303,10 @@ public class HumanTurnControl extends AbstractTurnControl { } pickUpSelectedStones(); - turnInfo.getTable().drop(new StoneSet(selectedStones), new Position(position.getX() - - selectedStones.size() * 0.5f, position.getY() - 0.5f)); + turnInfo.getTable().drop( + new StoneSet(selectedStones), + new Position(position.getX() - selectedStones.size() * 0.5f, position + .getY() - 0.5f)); selectedStones.clear(); view.getTablePanel().setStoneSets(turnInfo.getTable()); @@ -421,15 +422,14 @@ public class HumanTurnControl extends AbstractTurnControl { turnInfo.getTable().drop(joinedSet, newPos); } else { StoneSet joinedSet = new StoneSet(selectedStones).join(newSet); - turnInfo.getTable().drop(joinedSet, new Position(newPos.getX() - - selectedStones.size(), newPos.getY())); + turnInfo.getTable().drop(joinedSet, + new Position(newPos.getX() - selectedStones.size(), newPos.getY())); } } else { turnInfo.getTable().drop( new StoneSet(selectedStones), - new Position(pos.getX() - + (set.getSize() - selectedStones.size()) * 0.5f, - pos.getY())); + new Position(pos.getX() + (set.getSize() - selectedStones.size()) + * 0.5f, pos.getY())); } selectedStones.clear(); @@ -521,8 +521,7 @@ public class HumanTurnControl extends AbstractTurnControl { static class HandStonePositionComparator implements Comparator<Pair<Stone, Position>> { @Override - public int compare(Pair<Stone, Position> pair1, - Pair<Stone, Position> pair2) { + public int compare(Pair<Stone, Position> pair1, Pair<Stone, Position> pair2) { Position pos1 = pair1.getSecond(), pos2 = pair2.getSecond(); if (pos1.getY() < pos2.getY()) { return -1; |