SevenCardStud.cpp
//
// SevenCardStud::round() 
// loop through the list of players and call after_turn on each of them
// manage the game, deal cards to players in each round and ask for betting
//

:round()
loop through the list of players and call after_turn on each of them
manage the game, deal cards to players in each round and ask for betting
: round () loop through the list of players and call after_turn on each of them manage the game deal cards to players in each round and ask for betting
int SevenCardStud::round()
{
	int upCardRounds = 3;
	for (auto j = 0; j < upCardRounds; j++){
		if (!allButOneFolded()){
			unsigned int nextPlayer = 1;
			unsigned int i = 0;
			int dealToIndex = dealer_index;
			auto upCardsPerPlayer = 1;
			if (players.size()*upCardsPerPlayer > main_deck.size()){
				throw errors::not_enough_cards;
			}
			while (i < players.size())
			{
				dealToIndex = (dealToIndex + nextPlayer) % players.size();
				players[dealToIndex]->upCards << main_deck;
				i++;
			}
			bet();
		}
	}
	if (!allButOneFolded()){
		unsigned int nextPlayer = 1;
		unsigned int i = 0;
		int dealToIndex = dealer_index;
		auto downCardsPerPlayer = 1;
		if (players.size()*downCardsPerPlayer > main_deck.size()){
			throw errors::not_enough_cards;
		}
		while (i < players.size())
		{
			dealToIndex = (dealToIndex + nextPlayer) % players.size();
			players[dealToIndex]->downCards << main_deck;
			i++;
		}
		bet();
	}
	return errors::noError;
}
int SevenCardStud :: round ( ) { int upCardRounds = 3 ; for ( auto j = 0 ; j < upCardRounds ; j ++ ) { if ( ! allButOneFolded ( ) ) { unsigned int nextPlayer = 1 ; unsigned int i = 0 ; int dealToIndex = dealer_index ; auto upCardsPerPlayer = 1 ; if ( players . size ( ) * upCardsPerPlayer > main_deck . size ( ) ) { throw errors :: not_enough_cards ; } while ( i < players . size ( ) ) { dealToIndex = ( dealToIndex + nextPlayer ) % players . size ( ) ; players [ dealToIndex ] -> upCards << main_deck ; i ++ ; } bet ( ) ; } } if ( ! allButOneFolded ( ) ) { unsigned int nextPlayer = 1 ; unsigned int i = 0 ; int dealToIndex = dealer_index ; auto downCardsPerPlayer = 1 ; if ( players . size ( ) * downCardsPerPlayer > main_deck . size ( ) ) { throw errors :: not_enough_cards ; } while ( i < players . size ( ) ) { dealToIndex = ( dealToIndex + nextPlayer ) % players . size ( ) ; players [ dealToIndex ] -> downCards << main_deck ; i ++ ; } bet ( ) ; } return errors :: noError ; }
SevenCardStud::round()
loop through the list of players and call after_turn on each of them
manage the game, deal cards to players in each round and ask for betting
SevenCardStud :: round () loop through the list of players and call after_turn on each of them manage the game deal cards to players in each round and ask for betting
//deal up cards to players 3 times
 // deal the last down cards to players
