Example #1
0
void HoldEmTable::DealCommunityCards(int x)
{
	_discard.push_back(_deck->DrawCard()); //burn
	for(int i=0; i< x; i++ )
	{
		Card* c = _deck->DrawCard();
		_communitycards.push_back(c);
		tablelog << "Dealt Community Card " << c->GetValue() << " of " << c->GetSuitString() << endl;
		NotifyAllCommunityCard(c);
	}
}
Example #2
0
void HoldEmTable::CollectBlindsAndDeal()
{
	int smblind = _currentblind / 2;
	int cardsdealtperplayer = 0;

	if( 2 != GetNumberOfPlayers() )
		_actionto = GetNextPosition(_dealerposition);

	_pot[_actionto] += _seat[_actionto]->CollectBlind(smblind);
	if( _pot[_actionto] == smblind )
	{
		tablelog << "Position " << _actionto << " paid small blind " << smblind << endl;
		NotifyAllAction(_actionto, smblind );
	}
	else
	{
		BootPlayer(_actionto);
	}

	_actionto = GetNextPosition(_actionto);

	_pot[_actionto] += _seat[_actionto]->CollectBlind(_currentblind);
	if( _pot[_actionto] == _currentblind )
	{
		tablelog << "Position " << _actionto << " paid big blind " << _currentblind << endl;
		NotifyAllAction(_actionto, _currentblind );
		_option = _actionto;
	}
	else
	{
		BootPlayer(_actionto);
	}

	_actionto = GetNextPosition(_actionto);

	unsigned int dealto = _dealerposition;
	do{ dealto = GetNextPosition(dealto);
		if( dealto == _dealerposition )
			cardsdealtperplayer++;

		Card* c = _deck->DrawCard();
		_seat[dealto]->DealCard(c);
		tablelog << "Dealt Card "  << c->GetValue() << " of " << c->GetSuitString() << " to position " << dealto << endl;
	} while( cardsdealtperplayer != 2 );
}