Package com.svanloon.game.wizard.client.player

Examples of com.svanloon.game.wizard.client.player.Player


   * Document the main method
   *
   * @param args
   */
  public static void main(String[] args) {
    Player player = null;
    BotRunner client = new BotRunner(player);
    Thread t = new Thread(client);
    t.start();
    try {
      t.join();
View Full Code Here


    commandPort = getCommandPort(message);
    eventPort = getEventPort(message);
    _logger.info("commandPort = " + commandPort);
    _logger.info("eventPort = " + eventPort);

    Player player = scottPlayer;

    ClientCommandNotifier mr = new ClientCommandNotifier(player, ip, commandPort);
    Thread mrt = new Thread(mr);
    mrt.start();
View Full Code Here

    }

    for(int totalPlayerNumberIndex = 0 ; totalPlayerNumberIndex < totalNumberOfPlayers; totalPlayerNumberIndex++) {
      //_logger.info("Getting player " + i + "'s information");
      int id = (totalPlayerNumberIndex+1)*21601;
      Player player;
      if((numberOfHumanPlayers == -1) || // computer players play themselves
         (numberOfHumanPlayers == 0 && totalPlayerNumberIndex > 0) || // assumes 1 player + n-1 computers
         (numberOfHumanPlayers == 1 && totalPlayerNumberIndex > 0) ||  // assumes 1 player + n-1 computers
         (numberOfHumanPlayers == 2 &&
             (
               (totalNumberOfPlayers == 3 && totalPlayerNumberIndex == 1) ||
                 (totalNumberOfPlayers == 4 && (totalPlayerNumberIndex == 1 || totalPlayerNumberIndex == 3)) ||
                 (totalNumberOfPlayers == 5 && (totalPlayerNumberIndex == 1 || totalPlayerNumberIndex == 3 || totalPlayerNumberIndex == 4)) ||
                 (totalNumberOfPlayers == 6 && (totalPlayerNumberIndex == 1 || totalPlayerNumberIndex == 3 || totalPlayerNumberIndex == 4 || totalPlayerNumberIndex == 5))
             )
         ) ||
         (numberOfHumanPlayers == 3 &&
             (
                 (totalNumberOfPlayers == 4 && (totalPlayerNumberIndex == 3)) ||
                 (totalNumberOfPlayers == 5 && (totalPlayerNumberIndex == 1 || totalPlayerNumberIndex == 3)) ||
                 (totalNumberOfPlayers == 6 && (totalPlayerNumberIndex == 1 || totalPlayerNumberIndex == 3 || totalPlayerNumberIndex == 5))
             )
         ) ||
         (numberOfHumanPlayers == 4 &&
             (
                 (totalNumberOfPlayers == 5 && (totalPlayerNumberIndex == 1)) ||
                 (totalNumberOfPlayers == 6 && (totalPlayerNumberIndex == 1 || totalPlayerNumberIndex == 3))
             )
         ) ||
         (numberOfHumanPlayers == 5 &&
             (
                 (totalNumberOfPlayers == 6 && (totalPlayerNumberIndex == 1 ))
             )
         )
        
       ) {
       
        Player bot;
        if (botsIterator.hasNext()) {
          bot = botsIterator.next();

          if (bot instanceof GameEventListener) {
            wizardEngine.addGameEventListener((GameEventListener) bot );
View Full Code Here

    for (int i = 0; i < round; i++) {
      for (Player player: new PlayerIterator(_playerCollection, lead)) {
        player.giveCard(deck.getCard());
      }
    }
    Player dealerPlayer = this._playerCollection.get(dealer);
    gameEventNotifier.notify(new HandDealtEvent(dealerPlayer.getId()));

    if (deck.hasCards()) {
      return deck.getCard();
    }
   
View Full Code Here

      Card trump = dealCards(roundId, dealer, lead);
      gameEventNotifier.notify(new NewTrumpEvent(trump));
      round.setTrump(trump);

      if(trump != null && trump.getValue().equals(Value.WIZARD)) {
        Player trumpPicker = _playerCollection.get(dealer);
        //_logger.info(trumpPicker.getName() + " gets to pick trump.");
        trump = new Card(null, trumpPicker.pickTrump(), -1);
        gameEventNotifier.notify(new NewTrumpEvent(trump));
        round.setTrump(trump);
      }
      int cardsDealt = roundId;
      Bid bid = bid(trump, lead, cardsDealt, round);
View Full Code Here

    public boolean hasNext() {
      return (i < this.players.size());
    }

    public Player next() {
      Player result = this.players.get((lead + i) % this.players.size());
      i++;
      return result;
    }
View Full Code Here

TOP

Related Classes of com.svanloon.game.wizard.client.player.Player

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.