示例#1
0
  private void initializeARSE() {
    arseGUI.addPlayerListener(
        new SelectionListener() {
          public void widgetSelected(SelectionEvent e) {
            playerMode = true;
            shell.dispose();
          }

          public void widgetDefaultSelected(SelectionEvent e) {
            playerMode = true;
            shell.dispose();
          }
        });
    arseGUI.addGameMasterListener(
        new SelectionListener() {
          public void widgetSelected(SelectionEvent e) {
            gameMasterMode = true;
            shell.dispose();
          }

          public void widgetDefaultSelected(SelectionEvent e) {
            gameMasterMode = true;
            shell.dispose();
          }
        });
  }
示例#2
0
  private void runSession() {
    while (true) {
      shell = arseGUI.open(display);
      initializeARSE();
      while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) display.sleep();
      }

      if (gameMasterMode) {
        gameMasterSession = new GameMasterSession(display);
        gameMasterSession.open();

        gameMasterMode = false;
      } else if (playerMode) {
        playerLoginGUI = new PlayerLoginGUI();
        playerSession = new PlayerSession(display);
        shell = playerLoginGUI.open(display);
        initializePlayerLoginGUI();
        while (!shell.isDisposed()) {
          if (!display.readAndDispatch()) display.sleep();
        }

        if (playerSession.loggedIn()) {
          playerSession.open();
        }
        playerMode = false;
      } else break;
    }
  }