diff options
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r-- | src/jrummikub/control/TurnControl.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/jrummikub/control/TurnControl.java b/src/jrummikub/control/TurnControl.java index bf921e4..e82b30f 100644 --- a/src/jrummikub/control/TurnControl.java +++ b/src/jrummikub/control/TurnControl.java @@ -21,7 +21,7 @@ import jrummikub.util.Pair; import jrummikub.view.IView; public class TurnControl { - private static class HandStoneComparator implements + static class HandStonePositionComparator implements Comparator<Pair<Stone, Position>> { @Override public int compare(Pair<Stone, Position> pair1, @@ -161,6 +161,20 @@ public class TurnControl { connectorClick(set, true); } })); + connections.add(view.getPlayerPanel().getSortByGroupsEvent() + .add(new IListener() { + @Override + public void handle() { + sortByGroups(); + } + })); + connections.add(view.getPlayerPanel().getSortByRunsEvent() + .add(new IListener() { + @Override + public void handle() { + sortByRuns(); + } + })); view.getPlayerPanel().getHandPanel().setStones(hand.clone()); view.enableStartTurnPanel(false); @@ -168,11 +182,11 @@ public class TurnControl { timer.startTimer(); } - private void sortByValue() { + private void sortByRuns() { } - private void sortByColor() { + private void sortByGroups() { } @@ -286,7 +300,7 @@ public class TurnControl { handPairs.add(entry); } - Collections.sort(handPairs, new HandStoneComparator()); + Collections.sort(handPairs, new HandStonePositionComparator()); List<Stone> handStones = new ArrayList<Stone>(); for (Pair<Stone, Position> entry : handPairs) { @@ -338,8 +352,7 @@ public class TurnControl { - selectedStones.size(), newPos.getY())); } } else { - table.drop(new StoneSet(selectedStones), new Position(pos.getX() - + (set.size() - selectedStones.size()) * 0.5f, pos.getY())); + table.drop(new StoneSet(selectedStones), new Position(RoundControl.HAND_WIDTH-1, RoundControl.HAND_HEIGHT-1)); } selectedStones.clear(); |