added the constructors for all client states and their statemachines

This commit is contained in:
Fleischer Hanno
2024-11-24 16:02:04 +01:00
parent f425eff26b
commit 1d4048cf16
46 changed files with 319 additions and 9 deletions

View File

@@ -1,4 +1,33 @@
package pp.mdga.client;
public abstract class ClientState {
public abstract class ClientState implements Observer {
protected static final System.Logger LOGGER = System.getLogger(ClientState.class.getName());
protected ClientState parent;
protected ClientGameLogic logic;
protected ClientState(ClientState parent, ClientGameLogic logic){
this.parent = parent;
this.logic = logic;
}
public void entry(){/* do nothing */}
public void exit() {/* do nothing*/}
public void gotoState(ClientState newState){
throw new IllegalStateException("not in a statemachine");
}
public ClientState getParent(){
return parent;
}
public void update() {/* do nothing */}
@Override
public String toString(){
return getClass().getSimpleName();
}
}