コード例 #1
0
ファイル: Engine.java プロジェクト: Eway/whereigo
  /** thread's run() method that does all the work in the right order */
  public void run() {
    try {
      if (log != null)
        log.println(
            "-------------------\ncartridge "
                + gwcfile.name
                + " started (openWIG r"
                + VERSION
                + ")\n-------------------");
      prepareState();

      if (doRestore) restoreGame();
      else newGame();

      loglevel = LOG_PROP;

      ui.debugMsg("Starting game...\n");
      ui.start();

      player.refreshLocation();
      cartridge.callEvent(doRestore ? "OnRestore" : "OnStart", null);
      ui.refresh();
      eventRunner.unpause();

      mainloop();
    } catch (IOException e) {
      ui.showError("Could not load cartridge: " + e.getMessage());
    } catch (Throwable t) {
      stacktrace(t);
    } finally {
      ui.end();
    }
  }
コード例 #2
0
ファイル: Engine.java プロジェクト: Eway/whereigo
 public void run() {
   synchronized (instance) {
     ui.refresh();
     refreshScheduled = false;
   }
 }