summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-24 22:16:16 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-24 22:16:16 +0200
commit81ca3e174a7d69bd063b80d3512438fd3a89a077 (patch)
tree40a0c845e920a0d93c86329dbd2b00f8f8b9c925 /src
parent8c3c66f361934e521ef7d00e9464cfc51875badc (diff)
downloadJRummikub-81ca3e174a7d69bd063b80d3512438fd3a89a077.tar
JRummikub-81ca3e174a7d69bd063b80d3512438fd3a89a077.zip
Renamed win() and fixed end of round tests
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@267 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src')
-rw-r--r--src/jrummikub/control/GameControl.java2
-rw-r--r--src/jrummikub/control/RoundControl.java16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/jrummikub/control/GameControl.java b/src/jrummikub/control/GameControl.java
index ac47e2f..1d50bc6 100644
--- a/src/jrummikub/control/GameControl.java
+++ b/src/jrummikub/control/GameControl.java
@@ -63,7 +63,7 @@ public class GameControl {
roundState.setActivePlayerNumber(gameState.getFirstRoundFirstPlayer());
roundControl = new RoundControl(roundState, view);
- roundControl.getEndRoundEvent().add(new IListener() {
+ roundControl.getEndOfRoundEvent().add(new IListener() {
@Override
public void handle() {
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java
index e10950d..d7a27bb 100644
--- a/src/jrummikub/control/RoundControl.java
+++ b/src/jrummikub/control/RoundControl.java
@@ -26,7 +26,7 @@ public class RoundControl {
private IRoundState roundState;
private IView view;
private ITable clonedTable;
- private Event endRoundEvent = new Event();
+ private Event endOfRoundEvent = new Event();
private List<Connection> connections = new ArrayList<Connection>();
private boolean roundFinished;
@@ -46,10 +46,10 @@ public class RoundControl {
/**
* End the round
*
- * @return endRoundEvent
+ * @return endOfRoundEvent
*/
- public IEvent getEndRoundEvent() {
- return endRoundEvent;
+ public IEvent getEndOfRoundEvent() {
+ return endOfRoundEvent;
}
/**
@@ -134,7 +134,7 @@ public class RoundControl {
} else {
if (roundState.getActivePlayer() == roundState.getLastPlayer()) {
// TODO check who has won
- win();
+ endOfRound();
} else {
roundState.nextPlayer();
}
@@ -171,7 +171,7 @@ public class RoundControl {
} else {
roundState.getActivePlayer().setLaidOut(true);
if (roundState.getActivePlayer().getHand().getSize() == 0) {
- win();
+ endOfRound();
}
}
}
@@ -235,11 +235,11 @@ public class RoundControl {
dealStones(count + 3);
}
- private void win() {
+ private void endOfRound() {
for (Connection c : connections) {
c.remove();
}
- endRoundEvent.emit();
+ endOfRoundEvent.emit();
view.enableWinPanel(true);
roundFinished = true;
}