Examples of PlayerMove


Examples of com.poker.shared.PlayerMove

     */
  public void doChoose(Choose choose, int chipPairsPlus, int chipAnte) {
    switch (choose) {
    case PairsPlus:     
        stateChanger.setChoice(state, state.getPlayerTurn(),
            new PlayerMove(Choose.PairsPlus), chipPairsPlus, chipAnte);
        if (state.getPlayerTurn() == 0) {
          state.setNextPlayerTurn();
          graphics.showGameTurn(state.getPlayerTurn(),AI);
          //setState(this.state);
          //History.newItem(serializeState(state));         
          graphics.setNotDraggable();
          drag=false;
          if(!AI)
                        pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
         
        }

        else {         
          state.setNextPlayerTurn();
          graphics.showGameTurn(state.getPlayerTurn(),AI);
          graphics.showGameInfo(state.getProcess());
          graphics.playChooseSound();
          //setState(this.state);
          //History.newItem(serializeState(state));     
            pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
              
          if (state.getPlayers().get(0).getChoose() == Choose.Ante){
            graphics.setPlayBtn(true);
            graphics.setFoldBtn(true);
          }
          else
            graphics.setDealBtn(true);             
        }

      break;
    case Ante:
        stateChanger.setChoice(state, state.getPlayerTurn(),new PlayerMove(Choose.Ante), chipPairsPlus, chipAnte);
        if (state.getPlayerTurn() == 0) {
          state.setNextPlayerTurn();
          graphics.showGameInfo(state.getPlayerTurn());
          //setState(this.state);
          //History.newItem(serializeState(state));
          graphics.setNotDraggable();
          drag=false;
          if(!AI)
                       pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
         
        }

        else {
          state.setNextPlayerTurn();
          graphics.showGameInfo(state.getPlayerTurn());
          graphics.showGameInfo(state.getProcess());
          graphics.playChooseSound();
          //setState(this.state);
          //History.newItem(serializeState(state));
          pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
         
          if (state.getPlayers().get(0).getChoose() == Choose.Ante){
            graphics.setPlayBtn(true);
            graphics.setFoldBtn(true);
          }
          else
            graphics.setDealBtn(true);
        }

      break;
    case PairsPlusAnte:
        stateChanger.setChoice(state, state.getPlayerTurn(),new PlayerMove(Choose.PairsPlusAnte), chipPairsPlus, chipAnte);
        if (state.getPlayerTurn() == 0) {
          state.setNextPlayerTurn();
          graphics.showGameInfo(state.getPlayerTurn());
          //setState(this.state);
          //History.newItem(serializeState(state));
          graphics.setNotDraggable();
          drag=false;
          if(!AI)
             pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
         
        }

        else {
          state.setNextPlayerTurn();
          graphics.showGameInfo(state.getPlayerTurn());
          graphics.showGameInfo(state.getProcess());
          graphics.playChooseSound();
          //setState(this.state);
          //History.newItem(serializeState(state));
          pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
         
          if (state.getPlayers().get(0).getChoose() == Choose.Ante){
            graphics.setPlayBtn(true);
            graphics.setFoldBtn(true);
          }
          else
            graphics.setDealBtn(true);
        }       
      break;
    default:
      break;
    }
    if(AI){           
      String s=myPokerAI.getChoose();
      if(s=="Ante"){
        chipAnte=myPokerAI.getChip();
        chipPairsPlus=0;
        stateChanger.setChoice(state, state.getPlayerTurn(),
            new PlayerMove(Choose.Ante), chipPairsPlus, chipAnte);
      }
      else if(s=="PairsPlus"){
        chipPairsPlus=myPokerAI.getChip();
        chipAnte=0;
        stateChanger.setChoice(state, state.getPlayerTurn(),
            new PlayerMove(Choose.PairsPlus), chipPairsPlus, chipAnte);
      }
      else if(s=="PairsPlusAnte"){
        chipPairsPlus=myPokerAI.getChip();
        chipAnte=myPokerAI.getChip();
        stateChanger.setChoice(state, state.getPlayerTurn(),
            new PlayerMove(Choose.PairsPlus), chipPairsPlus, chipAnte);
      }
      state.setNextPlayerTurn();
      graphics.showGameInfo(state.getProcess());
      graphics.playChooseSound();
      if (state.getPlayers().get(0).getChoose() == Choose.Ante){
View Full Code Here

Examples of com.poker.shared.PlayerMove

    case Deal:
      if (state.getPlayerTurn() == 0) {
        if (state.getPlayers().get(0).getChoose() == Choose.PairsPlus) {
          gameResult1 = stateChanger.makeMove(state,
              state.getPlayerTurn(),
              new PlayerMove(Decision.Deal));
          state.getPlayers().get(0).setResult(gameResult1.getResult());
          state.setPlayerBalance(0, gameResult1.getBalance());
          state.setNextPlayerTurn();
          graphics.showGameInfo(state.getPlayerTurn());
          //setState(this.state);
          //History.newItem(serializeState(state));
          if(!AI)
               pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
         
          if (state.getPlayers().get(1).getChoose() == Choose.Ante){
            graphics.setPlayBtn(true);
            graphics.setFoldBtn(true);
            graphics.setDealBtn(false);
          }
          else{
            graphics.setDealBtn(true);
            graphics.setPlayBtn(false);
            graphics.setFoldBtn(false);
          }
         
          //if player play with computer
          if(AI){
            if (state.getPlayers().get(1).getChoose() == Choose.PairsPlus) {
              gameResult2 = stateChanger.makeMove(state,
                  state.getPlayerTurn(),
                  new PlayerMove(Decision.Deal));
              state.getPlayers().get(1).setResult(gameResult2.getResult());
              state.setPlayerBalance(1, gameResult2.getBalance());
              graphics.playDecisionSound();
              setState(state);
              graphics.setRestartBtn(true);
              }
            else if (state.getPlayers().get(1).getChoose() == Choose.Ante){
              String decison=myPokerAI.getDecision(state);
              if(decison=="Play"){
                gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Play));
                state.getPlayers().get(1).setResult(gameResult2.getResult());
                state.setPlayerBalance(1, gameResult2.getBalance());
                graphics.playDecisionSound();
                    setState(state);
                    graphics.showComputerDecision("Computer decide: Play");
                graphics.setRestartBtn(true);
              }
              else if(decison=="Flod"){
                gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Fold));
                state.getPlayers().get(1).setResult(gameResult2.getResult());
                state.setPlayerBalance(1, gameResult2.getBalance());
                graphics.playDecisionSound();
                setState(state);
                graphics.showComputerDecision("Computer decide: Fold");
                graphics.setRestartBtn(true);
              }
            }
            else{
                 gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Deal));
                 state.setPlayerBalance(1, gameResult2.getBalance());
                 String decison=myPokerAI.getDecision(state);
                if(decison=="Play"){
                  gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Play));
                  state.getPlayers().get(1).setResult(gameResult2.getResult());
                  state.setPlayerBalance(1, gameResult2.getBalance());
                  graphics.playDecisionSound();
                      setState(state);
                  graphics.setRestartBtn(true);
                }
                else if(decison=="Flod"){
                  gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Fold));
                  state.getPlayers().get(1).setResult(gameResult2.getResult());
                  state.setPlayerBalance(1, gameResult2.getBalance());
                  graphics.playDecisionSound();
                  setState(state);
                  graphics.setRestartBtn(true);
                }
            }
          } 
           
        }
        else {
          gameResult1 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Deal));
          state.setPlayerBalance(0, gameResult1.getBalance());         
                    graphics.setPlayBtn(true);
                    graphics.setFoldBtn(true);
                    graphics.setDealBtn(false);
          }
       
       } else {
        if (state.getPlayers().get(1).getChoose() == Choose.PairsPlus) {
          gameResult2 = stateChanger.makeMove(state,
              state.getPlayerTurn(),
              new PlayerMove(Decision.Deal));
          state.getPlayers().get(1).setResult(gameResult2.getResult());
          state.setPlayerBalance(1, gameResult2.getBalance());
          graphics.playDecisionSound();
          //setState(this.state);
          //History.newItem(serializeState(state));         
         
          pokerService.EndMove(serializeState(this.state), currentMatchId,userId, otherId, meID,updateCallback);
          graphics.setRestartBtn(true);
                   
        } else {
          gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Deal));
          state.setPlayerBalance(1, gameResult2.getBalance());
          graphics.setPlayBtn(true);
                    graphics.setFoldBtn(true);
                    graphics.setDealBtn(false);
        }
      }
       
      break;
    case Play:
      if (state.getPlayerTurn() == 0) {
        if (state.getPlayers().get(0).getChoose() == Choose.Ante) {
          gameResult1 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Play));
          state.getPlayers().get(0).setResult(gameResult1.getResult());
          state.setPlayerBalance(0, gameResult1.getBalance());
          state.setNextPlayerTurn();
          graphics.showGameInfo(state.getPlayerTurn());
          //setState(this.state);
          //History.newItem(serializeState(state));
          if(!AI)
               pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
          if (state.getPlayers().get(1).getChoose() == Choose.Ante){
            graphics.setPlayBtn(true);
            graphics.setFoldBtn(true);
            graphics.setDealBtn(false);
          }
          else{
            graphics.setDealBtn(true);
            graphics.setPlayBtn(false);
            graphics.setFoldBtn(false);
          }
        } else {         
            gameResult1 = stateChanger.makeMove(state, state.getPlayerTurn(),new PlayerMove(Decision.Play));
            state.getPlayers().get(0).setResult(gameResult1.getResult());
            state.setPlayerBalance(0, gameResult1.getBalance());
            state.setNextPlayerTurn();
            graphics.showGameTurn(state.getPlayerTurn(),AI);
            if(!AI)
                 pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
            if (state.getPlayers().get(1).getChoose() == Choose.Ante){
              graphics.setPlayBtn(true);
              graphics.setFoldBtn(true);
              graphics.setDealBtn(false);
            }
            else{
              graphics.setDealBtn(true);
              graphics.setPlayBtn(false);
              graphics.setFoldBtn(false);
            }         
        }

        //if player play with computer
        if(AI){
          if (state.getPlayers().get(1).getChoose() == Choose.PairsPlus) {
            gameResult2 = stateChanger.makeMove(state,
                state.getPlayerTurn(),
                new PlayerMove(Decision.Deal));
            state.getPlayers().get(1).setResult(gameResult2.getResult());
            state.setPlayerBalance(1, gameResult2.getBalance());
            graphics.playDecisionSound();
            setState(state);
            graphics.setRestartBtn(true);
            }
          else if (state.getPlayers().get(1).getChoose() == Choose.Ante){
            String decison=myPokerAI.getDecision(state);
            if(decison=="Play"){
              gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Play));
              state.getPlayers().get(1).setResult(gameResult2.getResult());
              state.setPlayerBalance(1, gameResult2.getBalance());
              graphics.playDecisionSound();
                  setState(state);
                  graphics.showComputerDecision("Computer decide: Play");
              graphics.setRestartBtn(true);
            }
            else if(decison=="Flod"){
              gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Fold));
              state.getPlayers().get(1).setResult(gameResult2.getResult());
              state.setPlayerBalance(1, gameResult2.getBalance());
              graphics.playDecisionSound();
              setState(state);
              graphics.showComputerDecision("Computer decide: Fold");
              graphics.setRestartBtn(true);
            }
          }
          else{
               gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Deal));
               state.setPlayerBalance(1, gameResult2.getBalance());
               String decison=myPokerAI.getDecision(state);
              if(decison=="Play"){
                gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Play));
                state.getPlayers().get(1).setResult(gameResult2.getResult());
                state.setPlayerBalance(1, gameResult2.getBalance());
                graphics.playDecisionSound();
                    setState(state);
                graphics.setRestartBtn(true);
              }
              else if(decison=="Flod"){
                gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Fold));
                state.getPlayers().get(1).setResult(gameResult2.getResult());
                state.setPlayerBalance(1, gameResult2.getBalance());
                graphics.playDecisionSound();
                setState(state);
                graphics.setRestartBtn(true);
              }
          }
        } 
       
      } else {
        if (state.getPlayers().get(1).getChoose() == Choose.Ante) {
          gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Play));
          state.getPlayers().get(1).setResult(gameResult2.getResult());
          state.setPlayerBalance(1, gameResult2.getBalance());
          graphics.playDecisionSound();
          //setState(this.state);
          //History.newItem(serializeState(state));
         
          pokerService.EndMove(serializeState(this.state), currentMatchId,userId, otherId, meID,updateCallback);
          graphics.setRestartBtn(true);
        } else {
            gameResult2 = stateChanger.makeMove(state, state.getPlayerTurn(),new PlayerMove(Decision.Play));
            state.getPlayers().get(1).setResult(gameResult2.getResult());
            state.setPlayerBalance(1, gameResult2.getBalance());
            graphics.playDecisionSound();
            //setState(this.state);
            //History.newItem(serializeState(state));
           
            pokerService.EndMove(serializeState(this.state), currentMatchId,userId, otherId, meID,updateCallback);
            graphics.setRestartBtn(true);
          }

      }
      break;
    case Fold:
      if (state.getPlayerTurn() == 0) {
        if (state.getPlayers().get(0).getChoose() == Choose.Ante) {
          gameResult1 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Fold));
          state.getPlayers().get(0).setResult(gameResult1.getResult());
          state.setPlayerBalance(0, gameResult1.getBalance());
          state.setNextPlayerTurn();
          graphics.showGameTurn(state.getPlayerTurn(),AI);
          //setState(this.state);
          //History.newItem(serializeState(state));
          if(!AI)
               pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
          if (state.getPlayers().get(1).getChoose() == Choose.Ante){
            graphics.setPlayBtn(true);
            graphics.setFoldBtn(true);
            graphics.setDealBtn(false);
          }
          else{
            graphics.setDealBtn(true);
            graphics.setPlayBtn(false);
            graphics.setFoldBtn(false);
          }
        } else {
            gameResult1 = stateChanger.makeMove(state, state.getPlayerTurn(),new PlayerMove(Decision.Fold));
            state.getPlayers().get(0).setResult(gameResult1.getResult());
            state.setPlayerBalance(0, gameResult1.getBalance());
            state.setNextPlayerTurn();
            graphics.showGameTurn(state.getPlayerTurn(),AI);
            if(!AI)
                pokerService.AMove(serializeState(this.state), currentMatchId,userId, otherId, updateCallback);
            if (state.getPlayers().get(1).getChoose() == Choose.Ante){
              graphics.setPlayBtn(true);
              graphics.setFoldBtn(true);
              graphics.setDealBtn(false);
            }
            else{
              graphics.setDealBtn(true);
              graphics.setPlayBtn(false);
              graphics.setFoldBtn(false);
            }
          }

        //if player play with computer
        if(AI){
          if (state.getPlayers().get(1).getChoose() == Choose.PairsPlus) {
            gameResult2 = stateChanger.makeMove(state,
                state.getPlayerTurn(),
                new PlayerMove(Decision.Deal));
            state.getPlayers().get(1).setResult(gameResult2.getResult());
            state.setPlayerBalance(1, gameResult2.getBalance());
            graphics.playDecisionSound();
            setState(state);
            graphics.setRestartBtn(true);
            }
          else if (state.getPlayers().get(1).getChoose() == Choose.Ante){
            String decison=myPokerAI.getDecision(state);
            if(decison=="Play"){
              gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Play));
              state.getPlayers().get(1).setResult(gameResult2.getResult());
              state.setPlayerBalance(1, gameResult2.getBalance());
              graphics.playDecisionSound();
                  setState(state);
                  graphics.showComputerDecision("Computer decide: Play");
              graphics.setRestartBtn(true);
            }
            else if(decison=="Flod"){
              gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Fold));
              state.getPlayers().get(1).setResult(gameResult2.getResult());
              state.setPlayerBalance(1, gameResult2.getBalance());
              graphics.playDecisionSound();
              setState(state);
              graphics.showComputerDecision("Computer decide: Fold");
              graphics.setRestartBtn(true);
            }
          }
          else{
               gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Deal));
               state.setPlayerBalance(1, gameResult2.getBalance());
               String decison=myPokerAI.getDecision(state);
              if(decison=="Play"){
                gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Play));
                state.getPlayers().get(1).setResult(gameResult2.getResult());
                state.setPlayerBalance(1, gameResult2.getBalance());
                graphics.playDecisionSound();
                    setState(state);
                graphics.setRestartBtn(true);
              }
              else if(decison=="Flod"){
                gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Fold));
                state.getPlayers().get(1).setResult(gameResult2.getResult());
                state.setPlayerBalance(1, gameResult2.getBalance());
                graphics.playDecisionSound();
                setState(state);
                graphics.setRestartBtn(true);
              }
          }
        } 
       
      } else {
        if (state.getPlayers().get(1).getChoose() == Choose.Ante) {
          gameResult2 = stateChanger.makeMove(state,state.getPlayerTurn(),new PlayerMove(Decision.Fold));
          state.getPlayers().get(1).setResult(gameResult2.getResult());
          state.setPlayerBalance(1, gameResult2.getBalance());
          graphics.playDecisionSound();
          //setState(this.state);
          //History.newItem(serializeState(state));
         
          pokerService.EndMove(serializeState(this.state), currentMatchId,userId, otherId, meID,updateCallback);
          graphics.setRestartBtn(true);
        } else {
            gameResult2 = stateChanger.makeMove(state, state.getPlayerTurn(),new PlayerMove(Decision.Fold));
            state.getPlayers().get(1).setResult(gameResult2.getResult());
            state.setPlayerBalance(1, gameResult2.getBalance());
            graphics.playDecisionSound();
            //setState(this.state);
            //History.newItem(serializeState(state));
View Full Code Here

Examples of com.poker.shared.PlayerMove

  }
  
  @Test
  public void testSetChipForPairsPlus(){
    state.initialize();
    PlayerMove move=new PlayerMove();
    move.setPlayerChoose(PlayerMove.Choose.PairsPlus);
    stateChanger.setChoice(state,0,move,10,0);
    int expectedWagerPairsPlus=10;
    int expectedWagerAnte=0;
    int expectedWagerPlay=0;
    assertEquals(state.getPlayers().get(0).getChipPairsPlus(),expectedWagerPairsPlus);
View Full Code Here

Examples of com.poker.shared.PlayerMove

  }
 
  @Test
  public void testSetChipForAnte(){
    state.initialize();
    PlayerMove move=new PlayerMove();
    move.setPlayerChoose(PlayerMove.Choose.Ante);
    stateChanger.setChoice(state,1,move,0,10);
    int expectedWagerPairsPlus=0;
    int expectedWagerAnte=10;
    int expectedWagerPlay=0;
    assertEquals(state.getPlayers().get(1).getChipPairsPlus(),expectedWagerPairsPlus);
View Full Code Here

Examples of com.poker.shared.PlayerMove

  }
 
  @Test
  public void testSetChipForPairsPlusAnte(){
    state.initialize();
    PlayerMove move=new PlayerMove();
    move.setPlayerChoose(PlayerMove.Choose.PairsPlusAnte);
    stateChanger.setChoice(state,0,move,10,10);
    int expectedWagerPairsPlus=10;
    int expectedWagerAnte=10;
    int expectedWagerPlay=0;
    assertEquals(state.getPlayers().get(0).getChipPairsPlus(),expectedWagerPairsPlus);
View Full Code Here

Examples of com.poker.shared.PlayerMove

  }
 
  @Test
  public void testGiveCards(){
    state.initialize();
    PlayerMove move=new PlayerMove();
    move.setPlayerChoose(PlayerMove.Choose.PairsPlus);
    stateChanger.setChoice(state,0,move,10,0);
    stateChanger.setChoice(state,1,move,10,10);
    state.giveCards();
    int expectedNumberOfCards=3;
    assertEquals(state.getPlayers().get(0).getPlayerCards().size(),expectedNumberOfCards);
View Full Code Here

Examples of com.poker.shared.PlayerMove

    Card card6=new Card(Suit.SPADES,Rank.FIVE);
    player.add(card4);
      player.add(card5);
    player.add(card6);   
    state.setPlayerCards(0,player);
    PlayerMove move=new PlayerMove();
    move.setPlayerChoose(PlayerMove.Choose.PairsPlus);
    stateChanger.setChoice(state,0,move,10,0);
    move.setPlayerDecision(PlayerMove.Decision.Deal)
    int expectedBalance=990;
    GameOver.Result expectedLose=GameOver.Result.LOSE;
    GameOver gameover=stateChanger.makeMove(state,0,move);
    assertEquals(gameover.getResult(),expectedLose);
    assertEquals(gameover.getBalance(),expectedBalance);    
View Full Code Here

Examples of com.poker.shared.PlayerMove

    Card card6=new Card(Suit.SPADES,Rank.FIVE);
    player.add(card4);
      player.add(card5);
    player.add(card6);   
    state.setPlayerCards(1,player);
    PlayerMove move=new PlayerMove();
    move.setPlayerChoose(PlayerMove.Choose.Ante);
    stateChanger.setChoice(state,1,move,0,10);
    move.setPlayerDecision(PlayerMove.Decision.Fold)
    int expectedBalance=990;
    GameOver.Result expectedLose=GameOver.Result.LOSE;
    GameOver gameover=stateChanger.makeMove(state,1,move);
    assertEquals(gameover.getResult(),expectedLose);
    assertEquals(gameover.getBalance(),expectedBalance);    
View Full Code Here

Examples of com.poker.shared.PlayerMove

    player.add(card4);
      player.add(card5);
    player.add(card6);
    state.setDealerCards(dealer);
    state.setPlayerCards(0,player);
    PlayerMove move=new PlayerMove();
    move.setPlayerChoose(PlayerMove.Choose.Ante);
    stateChanger.setChoice(state,0,move,0,10);
    move.setPlayerDecision(PlayerMove.Decision.Play)
    int expectedBalance=1020;
    GameOver.Result expectedWin=GameOver.Result.WIN;
    GameOver gameover=stateChanger.makeMove(state,0,move);
    assertEquals(gameover.getResult(),expectedWin);
    assertEquals(gameover.getBalance(),expectedBalance);  
View Full Code Here

Examples of com.poker.shared.PlayerMove

    Card card6=new Card(Suit.SPADES,Rank.FIVE);
    player.add(card4);
      player.add(card5);
    player.add(card6);   
    state.setPlayerCards(1,player);
    PlayerMove move=new PlayerMove();
    move.setPlayerChoose(PlayerMove.Choose.PairsPlusAnte);
    stateChanger.setChoice(state,1,move,10,10);
    move.setPlayerDecision(PlayerMove.Decision.Fold)
    int expectedBalance=980;
    GameOver.Result expectedLose=GameOver.Result.LOSE;
    GameOver gameover=stateChanger.makeMove(state,1,move);
    assertEquals(gameover.getResult(),expectedLose);
    assertEquals(gameover.getBalance(),expectedBalance);    
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.