public void draw(Graphics2D g) { if (paused) { // draw the paused state } else if (infoPause) { infoState.draw(g); } else if (gameStates[currentState] != null) { gameStates[currentState].draw(g); } }
public void update() { if (paused) { // Handle a paused state } else if (infoPause) { infoState.update(); } else if (gameStates[currentState] != null) { gameStates[currentState].update(); } }