diff options
author | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-06-22 00:12:06 +0200 |
---|---|---|
committer | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-06-22 00:12:06 +0200 |
commit | b7da5ad6313ae17dee738593ab3482c56675b61a (patch) | |
tree | 8bed3e5162f926916e27d51ee65a60b05a33fcf0 /src/jrummikub | |
parent | 1823fb1610fde82a1c3ae60edf9ea187cf18e54c (diff) | |
download | JRummikub-b7da5ad6313ae17dee738593ab3482c56675b61a.tar JRummikub-b7da5ad6313ae17dee738593ab3482c56675b61a.zip |
network paket vollständig kommentiert
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@560 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub')
-rw-r--r-- | src/jrummikub/control/network/NetworkTurnControl.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/jrummikub/control/network/NetworkTurnControl.java b/src/jrummikub/control/network/NetworkTurnControl.java index 07d46ba..0f9c478 100644 --- a/src/jrummikub/control/network/NetworkTurnControl.java +++ b/src/jrummikub/control/network/NetworkTurnControl.java @@ -10,14 +10,28 @@ import jrummikub.util.IListener; import jrummikub.util.IListener1; import jrummikub.util.IListener2; +/** + * Turn control for network games + */ public class NetworkTurnControl extends AbstractTurnControl { private IConnectionControl connectionControl; private Event1<IRoundState> stateUpdateEvent = new Event1<IRoundState>(); + /** + * Creates new network turn control + * + * @param connectionControl + * the current connection control + */ public NetworkTurnControl(IConnectionControl connectionControl) { this.connectionControl = connectionControl; } + /** + * The state update event is emitted when the state is sent into the network + * + * @return the event + */ public IEvent1<IRoundState> getStateUpdateEvent() { return stateUpdateEvent; } @@ -34,7 +48,8 @@ public class NetworkTurnControl extends AbstractTurnControl { connections.add(connectionControl.getTurnEndEvent().add( new IListener2<IRoundState, InvalidTurnInfo>() { @Override - public void handle(IRoundState state, InvalidTurnInfo invalidTurnInfo) { + public void handle(IRoundState state, + InvalidTurnInfo invalidTurnInfo) { endOfTurn(state, invalidTurnInfo); } })); @@ -48,7 +63,8 @@ public class NetworkTurnControl extends AbstractTurnControl { timer.startTimer(); } - private void endOfTurn(IRoundState roundState, InvalidTurnInfo invalidTurnInfo) { + private void endOfTurn(IRoundState roundState, + InvalidTurnInfo invalidTurnInfo) { cleanUp(); endOfTurnEvent.emit(roundState, invalidTurnInfo); |