public void start() throws SimulationException { // thread has already been started // if (this.thread.getState() != State.NEW) return; // missing player to be registered // if (this.names[0] == null || this.names[1] == null) throw new SimulationException("There are missing players to be registered"); // everything ok, sending the first status // if (listener != null) listener.gameStateChanged(gameEvent); // starting thread // this.thread.start(); LOGGER.info( "Simulator started: {} x {} and " + this.board.getMineCount() + "mines", this.board.getCells().length, this.board.getCells()[0].length); }
public void onSimulationStart() { for (SimulationListener listener : simulation_listeners) listener.onStart(); }