Package com.svanloon.game.wizard.human

Examples of com.svanloon.game.wizard.human.HumanPlayerSwing


      name = getLocalName()
    } else {
      name = hps.getName();
    }
   
    HumanPlayerSwing player = hps;
    player.setName(name);
    wizardEngine.addGameEventListener(player);

    int port = imServer.getNextPort();
    imServer.addListener(port);
    IMClient imClient = new IMClient(name, "localhost", port);
    player.setImClient(imClient);

    return player;
  }
View Full Code Here


    LanguageFactory.setLocale(locale);

    // prompt to start game, host game, or connect to host
    if(gameType.equals(GameType.HOSTED)) {
      int numberOfPlayers = go.getTotalNumberOfPlayers();
      HumanPlayerSwing hps = new HumanPlayerSwing(numberOfPlayers, up);
      hps.setVisible(true);
      hps.setUserPreferences(up);
      Server server = new Server(hps, go, numberOfPlayers);
      server.setNumberOfPlayers(go.getTotalHumanPlayers());
      List<String> names = createListOfRandomNames();
      int counter = 0;
      for(String name : names) {
View Full Code Here

    int messengerPort = getMessengerPort(message);
    int totalNumberOfPlayers = getTotalNumberOfPlayers(message);
    _logger.info("commandPort = " + commandPort);
    _logger.info("eventPort = " + eventPort);

    HumanPlayerSwing player = new HumanPlayerSwing(totalNumberOfPlayers, up);
    player.setUserPreferences(up);

    player.setName(name);
    player.setId(playerId);
    player.setVisible(true);

    ClientCommandNotifier mr = new ClientCommandNotifier(player, ip, commandPort);
    Thread mrt = new Thread(mr);
    mrt.setName("ClientCommandNotifier" + commandPort);
    mrt.start();

    MessageReceiver emr;
    try {
      emr = new MessageReceiver(ip, eventPort);
    } catch (UnknownHostException e) {
      e.printStackTrace();
      return;
    } catch (IOException e) {
      e.printStackTrace();
      return;
    }

    ClientGameEventNotifier wen = new ClientGameEventNotifier(player, emr);
    Thread went = new Thread(wen);
    went.setName("ClientGameEventNotifier"+eventPort);
    went.start();

    IMClient imClient = new IMClient(name, ip, messengerPort);
    //imClient.setVisible(true);
    player.setImClient(imClient);
  }
View Full Code Here

TOP

Related Classes of com.svanloon.game.wizard.human.HumanPlayerSwing

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.