public void update(int countFullLine) { gameController.newElement(); countHighscore(countFullLine); if (gameController.testGameOver()) { mechanikController.stopMechanic(); gameController.resetGame(); this.mechanikController.newMechanik(); } }
public TetrisController(IGameController gameController, IMechanikController mechanikController) { this.gameController = gameController; this.mechanikController = mechanikController; spielarray = gameController.getSpielarray(); spielarray.registerObserverReset(this); spielfeld = gameController.getSpielfeld(); /* init Listener */ keyListener = new TetrisKeyListener(gameController); newGameListener = new NewGameListener(spielarray, gameController, mechanikController); frame = new Gui(newGameListener, keyListener, spielfeld); frame.validate(); frame.setWindowCenter(); frame.setVisible(true); }
/** * getStringInput calls the method getStringInput from {@link GameController} and returns the * users input. * * @return Returns user input. */ private String getStringInput() { String input = controller.getStringInput(); return input; }