added more logic for the server state diagram

This commit is contained in:
Daniel Grigencha
2024-11-17 20:17:19 +01:00
parent 9662e1f684
commit f379a6b638
21 changed files with 374 additions and 16 deletions

View File

@@ -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);
}
}
}