Fixed a bunch of network synchronization bugs
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@510 72836036-5685-4462-b002-a69064685172
This commit is contained in:
parent
74d8205f30
commit
0c3eb9a283
15 changed files with 137 additions and 94 deletions
|
@ -225,7 +225,7 @@ public class AIControl extends AbstractTurnControl {
|
|||
return;
|
||||
}
|
||||
cleanUp();
|
||||
endOfTurnEvent.emit(turnInfo.getTable());
|
||||
endOfTurnEvent.emit(null, null, turnInfo.getTable());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,12 +6,15 @@ import java.util.List;
|
|||
import jrummikub.control.ITurnTimer;
|
||||
import jrummikub.control.TurnTimer;
|
||||
import jrummikub.model.GameSettings;
|
||||
import jrummikub.model.IHand;
|
||||
import jrummikub.model.ITable;
|
||||
import jrummikub.util.Connection;
|
||||
import jrummikub.util.Event;
|
||||
import jrummikub.util.Event1;
|
||||
import jrummikub.util.Event3;
|
||||
import jrummikub.util.IEvent;
|
||||
import jrummikub.util.IEvent1;
|
||||
import jrummikub.util.IEvent3;
|
||||
import jrummikub.util.IListener;
|
||||
import jrummikub.view.IView;
|
||||
|
||||
|
@ -19,7 +22,7 @@ import jrummikub.view.IView;
|
|||
* Abstract base class for TurnControls
|
||||
*/
|
||||
public abstract class AbstractTurnControl implements ITurnControl {
|
||||
protected Event1<ITable> endOfTurnEvent = new Event1<ITable>();
|
||||
protected Event3<IHand, ITable, ITable> endOfTurnEvent = new Event3<IHand, ITable, ITable>();
|
||||
protected Event redealEvent = new Event();
|
||||
protected Event1<ITable> tableUpdateEvent = new Event1<ITable>();
|
||||
protected TurnInfo turnInfo;
|
||||
|
@ -30,7 +33,7 @@ public abstract class AbstractTurnControl implements ITurnControl {
|
|||
private boolean started = false;
|
||||
|
||||
@Override
|
||||
public IEvent1<ITable> getEndOfTurnEvent() {
|
||||
public IEvent3<IHand, ITable, ITable> getEndOfTurnEvent() {
|
||||
return endOfTurnEvent;
|
||||
}
|
||||
|
||||
|
|
|
@ -448,7 +448,7 @@ public class HumanTurnControl extends AbstractTurnControl {
|
|||
if (redeal) {
|
||||
redealEvent.emit();
|
||||
} else {
|
||||
endOfTurnEvent.emit(turnInfo.getTable());
|
||||
endOfTurnEvent.emit(null, null, turnInfo.getTable());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import jrummikub.model.IHand;
|
|||
import jrummikub.model.ITable;
|
||||
import jrummikub.util.IEvent;
|
||||
import jrummikub.util.IEvent1;
|
||||
import jrummikub.util.IEvent3;
|
||||
import jrummikub.view.IView;
|
||||
|
||||
/**
|
||||
|
@ -30,7 +31,7 @@ public interface ITurnControl {
|
|||
*
|
||||
* @return end of turn event
|
||||
*/
|
||||
public IEvent1<ITable> getEndOfTurnEvent();
|
||||
public IEvent3<IHand, ITable, ITable> getEndOfTurnEvent();
|
||||
|
||||
/**
|
||||
* Emitted when the round is aborted and needs to be restarted
|
||||
|
|
Reference in a new issue