Package com.poker.test

Source Code of com.poker.test.PokerTest

package com.poker.test;

import java.util.List;

import com.poker.analyst.AnalystResult;
import com.poker.analyst.element.Player;
import com.poker.analyst.element.Rounds;
import com.poker.analyst.elements.state.PlayerState;
import com.poker.analyst.strategy.DataForStrategy;
import com.poker.analyst.strategy.Strategy;
import com.poker.analyst.strategy.temp.SSSStrategy1;
import com.poker.control.PokerControl;
import com.poker.ui.robot.reaction.UIReaction;
import com.poker.ui.settings.rooms.events.EventType;
import com.poker.ui.windows.PlayWindow;

public class PokerTest {

  public static String bPathPF =
    "src/com/poker/test/buffer.pf";
 
  public static String bPathF =
    "src/com/poker/test/buffer.f";
 
  public static String bPathT =
    "src/com/poker/test/buffer.t";
 
  public static String bPathR =
    "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);
   
   
  }
}
TOP

Related Classes of com.poker.test.PokerTest

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.