return board;
}
public static PlayWindow fillPlayWindow(PlayWindow playWnd, String strBuffer) throws Exception{
PokerControl pControl = new PokerControl();
PokerData pdata = new PokerData();
final BufferParser bufferParser = pdata.getRoomSettings().getBufferParser("");
// Opening buffer
File file = new File(strBuffer);
FileReader fr = new FileReader(file);
char[] buffer = new char[10000];
fr.read(buffer);
strBuffer = new String(buffer);
strBuffer = strBuffer.trim();
//System.out.println(strBuffer);
ParserResult parserResult = null;
ParserResult parserResultPrev = null;
Board board = pControl.createBoardShablon(pdata);
board = prerareBoard(board, 10, 0, 9, 0.2f);
board.getPlayers().get(0).setStack(6.0f);
Board boardPrev = null;
Board boardPrevNew = null;
try {
parserResult = bufferParser.getParserResult(strBuffer,null);
if (parserResult.getCurrentRound() != Rounds.PREFLOP){
boardPrevNew = pControl.createBoardShablon(pdata);
boardPrevNew = prerareBoard(boardPrevNew, 10, 0, 9, 0.2f);
boardPrevNew.getPlayers().get(0).setStack(4.9f);
switch (parserResult.getCurrentRound()) {
case FLOP:
parserResultPrev = bufferParser.getParserResult(strBuffer,Rounds.PREFLOP);
break;
case TURN:
parserResultPrev = bufferParser.getParserResult(strBuffer,Rounds.FLOP);
break;
case RIVER:
parserResultPrev = bufferParser.getParserResult(strBuffer,Rounds.TURN);
break;
}
if (parserResultPrev == null) throw new Exception("prev buffer taking exception");
}
} catch (final Exception e) {
System.err.println("buffer taking exception");
e.printStackTrace();
return null;
}
playWnd.setCurrentRound(parserResult.getCurrentRound());
switch(parserResult.getCurrentRound()){
case PREFLOP :
playWnd.setPreflopBoard(null);
playWnd.setFlopBoard(null);
playWnd.setTurnBoard(null);
playWnd.setRiverBoard(null);
break;
case FLOP :
boardPrev = playWnd.getPreflopBoard();
break;
case TURN :
boardPrev = playWnd.getFlopBoard();
break;
case RIVER :
boardPrev = playWnd.getTurnBoard();
break;
}
if (parserResult.getCurrentRound() != Rounds.PREFLOP){
for (int i = 0; i< boardPrev.getPlayers().size() ; i++)
boardPrevNew.getPlayers().get(i).setPlayerState(boardPrev.getPlayers().get(i).getPlayerState());
boardPrevNew.setCurrentRound(boardPrev.getCurrentRound());
}
if (boardPrevNew != null){
boardPrevNew.setDealer(board.getDealer());
//boardPrevNew = pControl.setNamesToBoard(boardPrevNew,bufferParser.getPlayersName(strBuffer));
boardPrevNew = pControl.setParserResultsToBoard(pdata, pControl, boardPrevNew, parserResultPrev);
}
//board = pControl.setNamesToBoard(board,bufferParser.getPlayersName(strBuffer));
board = pControl.setParserResultsToBoard(pdata, pControl, board, parserResult);
switch(parserResult.getCurrentRound()){