23 lines
626 B
Java
23 lines
626 B
Java
package pp.mdga.server;
|
|
|
|
import pp.mdga.message.server.ResumeGame;
|
|
|
|
public class Interrupt extends ServerState {
|
|
private final GameState lastState;
|
|
|
|
public Interrupt(ServerState parent, ServerGameLogic logic, GameState lastState) {
|
|
super(parent, logic);
|
|
this.lastState = lastState;
|
|
logic.getGame().addObserver(this);
|
|
}
|
|
|
|
@Override
|
|
public void update() {
|
|
if (Boolean.FALSE.equals(logic.getGame().gameIsInterrupted())) {
|
|
broadcastUpdate(new ResumeGame());
|
|
parent.gotoState(lastState);
|
|
logic.getGame().removeObserver(this);
|
|
}
|
|
}
|
|
}
|