added more logic for the server state diagram
This commit is contained in:
@@ -3,5 +3,14 @@
|
||||
public class Interrupt extends ServerState {
|
||||
public Interrupt(ServerState parent, ServerGameLogic logic) {
|
||||
super(parent, logic);
|
||||
logic.getGame().addObserver(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
if (!logic.getGame().gameIsInterrupted()) {
|
||||
parent.gotoState(new GameState(parent, logic));
|
||||
logic.getGame().removeObserver(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user