return "cc" + spot;
}
public static TableDataIntf buildTableData(ServletRequest req) throws TransportException {
TableDataCommunity tableData = new TableDataCommunity();
Table table = new Table();
ArrayList<Card> communityCards = new ArrayList<Card>();
Card tmpCard = null;
Player tmpPlayer = null;
String playerFold = null;
int numOfPlayers = Integer.parseInt(req.getParameter(REQ_PARAM_NUM_PLAYERS));
// loop through all the players
for (int i = 1; i <= numOfPlayers; i++) {
tmpPlayer = new Player();
tmpCard = convertValueToCard(req.getParameter(getPlayerParamName(i, 1)));
if (tmpCard.getRank() != TransportUtils.UNKNOWN
&& tmpCard.getSuit() != TransportUtils.UNKNOWN) {
tmpPlayer.addCard(tmpCard);
}
tmpCard = convertValueToCard(req.getParameter(getPlayerParamName(i, 2)));
if (tmpCard.getRank() != TransportUtils.UNKNOWN
&& tmpCard.getSuit() != TransportUtils.UNKNOWN) {
tmpPlayer.addCard(tmpCard);
}
playerFold = req.getParameter(getPlayerFoldParamName(i));
tmpPlayer.setFolded(REQ_VALUE_FOLD.equals(playerFold));
tableData.addPlayer(tmpPlayer);
}
// loop through the community cards
boolean stop = false;
for (int i = 1; !stop && i <= 5; i++) {
tmpCard = convertValueToCard(req.getParameter(getCommunityParamName(i)));
if (tmpCard.getRank() != TransportUtils.UNKNOWN
&& tmpCard.getSuit() != TransportUtils.UNKNOWN) {
communityCards.add(tmpCard);
}
}
table.setCommunity(communityCards);
tableData.setGameTable(table);
// set the options
Hashtable<String, Object> options = new Hashtable<String, Object>();
int accuracyLevel = 1;
accuracyLevel = Integer.parseInt(req.getParameter(REQ_PARAM_ACCURACY_LEVEL));
options.put(CalcEngineFactory.ENGINE_PROPH_SIMS, accuracyLevel);
tableData.setOptions(options);
return tableData;
}