Package com.poker.analyst.strategy

Examples of com.poker.analyst.strategy.Strategy


    "src/com/poker/test/buffer.r";
 
 
  public static void main(String[] args) throws Exception {
    PokerControl pControl = new PokerControl();
    Strategy strategy = new SSSStrategy1("");
    DataForStrategy dfs = new DataForStrategy();
   
    PlayWindow playWnd = PlayWindowFactory.getPlayWindow();
    playWnd = FillPlayWindow.fillPlayWindow(playWnd, bPathPF);
  //  ViewBoard.viewBoard(playWnd, playWnd.getCurrentRound(), null);
    dfs.setCurrentBoard(playWnd.getCurrentBoard());
    dfs.setCurrentRound(playWnd.getCurrentRound());
    /* not realized yet
      dfs.setPlayerMoney(playWnd.getPlayerMoney());
    */
    //  0 - hero place
    dfs.setPlayerMoney(dfs.getCurrentBoard().getPlayers().get(0).getStack());
    dfs.setTotalBank(pControl.getAllRoundTotal(playWnd));
           
  //  System.out.println("Preflop board: "+ playWnd.getPreflopBoard());
    ViewBoard.viewBoard(playWnd, Rounds.PREFLOP, pControl);
   
    AnalystResult aResult = strategy.getReaction(dfs);
    System.out.println(aResult);
   
    System.out.println("//////////////////==========================================");
       playWnd = FillPlayWindow.fillPlayWindow(playWnd, bPathF);
       System.out.println("Preflop board2: " + playWnd.getPreflopBoard());
       System.out.println("flop    board : " + playWnd.getFlopBoard());      
      
       List<Player> player = playWnd.getFlopBoard().getPlayers();
       for(int i = 0; i<10;i++)
         if (i != 0 && i!= 8){
           player.get(i).setPlayerState(PlayerState.PRS_FOLD);
           player.get(i).setReaction(UIReaction.UIR_ACTION_FOLD);
         }
          
//     ViewBoard.viewBoard(playWnd, Rounds.PREFLOP, null);      
      ViewBoard.viewBoard(playWnd, playWnd.getCurrentRound(), null);     
   
    dfs.setCurrentBoard(playWnd.getCurrentBoard());
    dfs.setCurrentRound(playWnd.getCurrentRound());
    dfs.setPlayerMoney(dfs.getCurrentBoard().getPlayers().get(0).getStack());
    dfs.setTotalBank(pControl.getAllRoundTotal(playWnd));
    dfs.setPrevBoard(playWnd.getPreflopBoard());
   
    aResult = strategy.getReaction(dfs);
    System.out.println(aResult);
   
   
  }
View Full Code Here


   
    if (playWnd == null) {
      return null;
    }
    DataForStrategy dfs = new DataForStrategy();
    Strategy strategy = pdata.getProgramSettings().getStrategySSS();
   
    if (playWnd.getCurrentEvent() == EventType.ET_NEED_WAIT_BB) {
      return new AnalystResult(UIReaction.UIR_BB_WAIT_FOR, null);     
    }else
    if(playWnd.getCurrentEvent() == EventType.ET_SYSTEM_MESSAGE){
      return new AnalystResult(UIReaction.UIR_ACCEPT_SYSTEM_WINDOW, null);
    }
    else
    if(playWnd.getCurrentEvent() == EventType.ET_SYSTEM_MESSAGE_2){
      return new AnalystResult(UIReaction.UIR_ACCEPT_SYSTEM_WINDOW_2, null);
    }
    if (playWnd.getCurrentEvent() == EventType.ET_SET_BB) {
      dfs.setCurrentRound(playWnd.getCurrentRound());
      dfs.setCurrentBoard(playWnd.getPreflopBoard());
     
      if (strategy.maySitToTable(dfs))           
        return new AnalystResult(UIReaction.UIR_BB_SET, null);
      else 
        return new AnalystResult(UIReaction.UIR_CLOSE_WINDOW, "");
    }else {
     
     
      switch(playWnd.getCurrentRound()){
        case FLOP :
          dfs.setPrevBoard(playWnd.getPreflopBoard());
            break;
          case TURN :
            dfs.setPrevBoard(playWnd.getFlopBoard());
            break;
          case RIVER :
            dfs.setPrevBoard(playWnd.getTurnBoard());
            break;
          default:
            dfs.setPrevBoard(null);
      }
   

      //ViewBoard.viewBoard(playWnd, playWnd.getCurrentRound(), pControl);
      dfs.setCurrentBoard(playWnd.getCurrentBoard());
      dfs.setCurrentRound(playWnd.getCurrentRound());
      /* not realized yet
          dfs.setPlayerMoney(playWnd.getPlayerMoney());
       */
      //  0 - hero place
      dfs.setPlayerMoney(dfs.getCurrentBoard().getPlayers().get(0).getStack());
      dfs.setTotalBank(pControl.getAllRoundTotal(playWnd));

      AnalystResult aResult = strategy.getReaction(dfs);
      //System.out.println(aResult);         

      return aResult;
    }
  }
View Full Code Here

TOP

Related Classes of com.poker.analyst.strategy.Strategy

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.