Implemented redealing in RoundControl
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@287 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
f7743efa7d
commit
63397e2f5f
1 changed files with 14 additions and 1 deletions
|
@ -64,12 +64,18 @@ public class RoundControl {
|
||||||
deal();
|
deal();
|
||||||
|
|
||||||
connections.add(view.getStartTurnEvent().add(new IListener() {
|
connections.add(view.getStartTurnEvent().add(new IListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
startTurn();
|
startTurn();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
connections.add(view.getPlayerPanel().getRedealEvent().add(new IListener() {
|
||||||
|
@Override
|
||||||
|
public void handle() {
|
||||||
|
redeal();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
prepareTurn();
|
prepareTurn();
|
||||||
}
|
}
|
||||||
|
@ -314,4 +320,11 @@ public class RoundControl {
|
||||||
public IEvent getRestartRoundEvent() {
|
public IEvent getRestartRoundEvent() {
|
||||||
return restartRoundEvent;
|
return restartRoundEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void redeal() {
|
||||||
|
for (Connection c : connections) {
|
||||||
|
c.remove();
|
||||||
|
}
|
||||||
|
restartRoundEvent.emit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue