public void processAction(pokerActions action) { switch (action) { case pokerActions.TimeOut: fold(tableData.currentPos); //have work here break; case pokerActions.Fold: fold(tableData.currentPos); break; case pokerActions.Check: check(tableData.currentPos); break; case pokerActions.Call: call(tableData.currentPos); break; case pokerActions.Bet: bet(tableData.currentPos, tableData.currentAct.betAmount); break; default: break; } }
public void act() { while (Globals.serverStatus == ServerStatus.Running) { Thread.Sleep(100); if (tableData.tableSituation == TableSituation.Null) { if (PlayersCount() >= 2) { InitNewGame(); } else { Thread.Sleep(1000); } } else if (tableData.tableSituation == TableSituation.Ended) { processWinner(); tableData.tableSituation = TableSituation.Null; //it is end of game } else { if (isAnyToAct()) { nextTurn(); pokerActions playerAction = WaitForAction(); processAction(playerAction); } else { if (PlayingPlayerCount() >= 2 && tableData.tableSituation != TableSituation.River) { nextTableSituation(); } else { tableData.tableSituation = TableSituation.Ended; } } } } }