Package org.cspoker.server.embedded.gamecontrol

Examples of org.cspoker.server.embedded.gamecontrol.Game


    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();

    try {
      gameControl.call(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    // Flop Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    // Turn Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    // Final Round
    try {
      System.out.println("final round");
      gameControl.check(game.getCurrentPlayer());
      System.out.println("Check 1");
      gameControl.check(game.getCurrentPlayer());
      System.out.println("check 2");
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    GameFlowTest.logger.info("Next game...");

    GameFlowTest.logger.info("Current Player:" + game.getCurrentPlayer());
    GameFlowTest.logger.info("Next Dealer:" + game.getNextDealer());
    GameFlowTest.logger.info(game.getFirstToActPlayer());
    GameFlowTest.logger.info("Dealer: " + game.getDealer().getName());
    GameFlowTest.logger.info(game.getCurrentDealPlayers());
  }
View Full Code Here


    PlayingTableState gameControl = new PlayingTableState(pokerTable, table);

    events.ignore(); //TODO
   
    Game game = gameControl.getGame();
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    try {
      gameControl.fold(game.getCurrentPlayer());
      gameControl.fold(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

    assertFalse(gameControl.getRound() instanceof WaitingRound);
View Full Code Here

    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();

    try {
      gameControl.allIn(game.getCurrentPlayer());
      gameControl.fold(game.getCurrentPlayer());
      gameControl.fold(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();

    try {
      gameControl.allIn(game.getCurrentPlayer());
      gameControl.call(game.getCurrentPlayer());
      gameControl.call(game.getCurrentPlayer());

      gameControl.fold(game.getCurrentPlayer());
      gameControl.fold(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();
   
    events.checkEmpty();

    events.add(Events.allIn, Events.nextPlayer);
    events.add(Events.allIn, Events.nextPlayer);
    events.add(Events.call);
    events.add(Events.newRound, Events.newCommunityCards);
    events.add(Events.newRound, Events.newCommunityCards);
    events.add(Events.newRound, Events.newCommunityCards);
    events.add(Events.showHand, Events.showHand, Events.showHand, Events.winner);
   
    events.ignore();
   
    try {
      gameControl.raise(game.getCurrentPlayer(),100);
      gameControl.call(game.getCurrentPlayer());
      gameControl.call(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }

  }
View Full Code Here

    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();
   
    events.add(Events.call, Events.nextPlayer);
    events.add(Events.call, Events.nextPlayer);
    events.add(Events.check, Events.newRound, Events.newCommunityCards, Events.nextPlayer);
   
    try {
      gameControl.call(game.getCurrentPlayer());
      gameControl.call(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
   
    events.add(Events.allIn, Events.nextPlayer);
    events.add(Events.allIn, Events.nextPlayer);
    events.add(Events.allIn, Events.newRound, Events.newCommunityCards);
    events.add(Events.newRound, Events.newCommunityCards);
    events.add(Events.showHand, Events.showHand, Events.showHand, Events.winner);
   
    events.ignore();
   
    // Flop Round
    try {
      gameControl.allIn(game.getCurrentPlayer());
      gameControl.allIn(game.getCurrentPlayer());
      gameControl.allIn(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
    GameFlowTest.logger.info("Common Cards: " + game.getCommunityCards());

    // New game
    MutableSeatedPlayer testPlayer;
    try {
      testPlayer = new MutableSeatedPlayer(factory.createNewPlayer("Test", 150),150);
View Full Code Here

    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();

    events.add(Events.call, Events.nextPlayer);
    events.add(Events.call);
    events.add(Events.newRound, Events.newCommunityCards, Events.nextPlayer);
   
    try {
      gameControl.call(game.getCurrentPlayer());
      gameControl.call(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
   
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check);
    events.add(Events.newRound, Events.newCommunityCards, Events.nextPlayer);
   
    // Flop Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
   
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check);
    events.add(Events.newRound, Events.newCommunityCards, Events.nextPlayer);

    // Turn Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
   
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check);
    events.add(Events.showHand, Events.showHand, Events.showHand, Events.winner);

    events.ignore();

    // Final Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    GameFlowTest.logger.info("Betting Rules: "
        + gameControl.getGame().getBettingRules().toString());
    Game game = gameControl.getGame();

    GameFlowTest.logger.info("Dealer: " + game.getDealer());

    GameFlowTest.logger.info(game.getCurrentDealPlayers());
    GameFlowTest.logger.info("Kenzo's Cards: " + kenzo.getPocketCards());
    GameFlowTest.logger.info("Cedric's Cards: " + cedric.getPocketCards());
    GameFlowTest.logger.info("Guy's Cards: " + guy.getPocketCards());

    events.add(Events.raise, Events.nextPlayer);
View Full Code Here

    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
    Game game = gameControl.getGame();
   
    events.add(Events.call, Events.nextPlayer);
    events.add(Events.call, Events.nextPlayer);
    events.add(Events.raise, Events.nextPlayer);
    events.add(Events.call, Events.nextPlayer);
    events.add(Events.call, Events.newRound, Events.newCommunityCards, Events.nextPlayer);
   
    // Pre-flop Round
    assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
    try {
      gameControl.call(game.getCurrentPlayer());
      gameControl.call(game.getCurrentPlayer());

      // Big Blind Raises.
      gameControl.raise(game.getCurrentPlayer(), 20);

      assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
      gameControl.call(game.getCurrentPlayer());
      assertEquals(PreFlopRound.class, gameControl.getRound().getClass());
      gameControl.call(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
   
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check, Events.newRound, Events.newCommunityCards, Events.nextPlayer);
   
    // Flop Round
    assertEquals(FlopRound.class, gameControl.getRound().getClass());
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
   
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check, Events.newRound, Events.newCommunityCards, Events.nextPlayer);


    // Turn Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
   
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check, Events.nextPlayer);
    events.add(Events.check);
    events.add(Events.showHand, Events.showHand, Events.showHand, Events.winner);
    events.ignore();
   
    // Final Round
    try {
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
      gameControl.check(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

      fail(e.getMessage());
    } catch (PlayerListFullException e) {
      fail(e.getMessage());
    }
    PlayingTableState gameControl = new PlayingTableState(pokerTable, table, kenzo);
    Game game = gameControl.getGame();
   
    events.add(Events.newDeal, Events.newRound, Events.allIn, Events.allIn, Events.nextPlayer);
   
    try {
      gameControl.deal();
    } catch (IllegalActionException e1) {
      fail(e1.toString());
    }
   
    events.add(Events.call);
    events.add(Events.newRound, Events.newCommunityCards);
    events.add(Events.newRound, Events.newCommunityCards);
    events.add(Events.newRound, Events.newCommunityCards);
    events.add(Events.showHand, Events.showHand, Events.showHand, Events.winner);
    events.ignore();
   
    try {
      gameControl.call(game.getCurrentPlayer());
    } catch (IllegalActionException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.cspoker.server.embedded.gamecontrol.Game

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.