Exemplo n.º 1
0
void CSymbolEngineRaisersCallers::CalculateNOpponentsCheckingBettingFolded()
{
	_nplayerscallshort  = 0;
	_nopponentsbetting  = 0;
	_nopponentsfolded   = 0;
	_nopponentschecking = 0;

	for (int i=0; i<_nchairs; i++)
	{
		double current_players_bet = p_symbol_engine_chip_amounts->currentbet(i);
		if (current_players_bet < RaisersBet()
			&& p_scraper_access->PlayerHasCards(i))
		{
			_nplayerscallshort++;
		}
		if (i == _userchair)
		{
			// No opponent;
			// Nothing more to do
			continue;
		}
		if (current_players_bet > 0) 
		{
			_nopponentsbetting++;
		}
		// Players might have been betting, but folded, so no else for the if
		if ((_playersdealtbits & (1<<(i)))
			&& ((p_scraper->card_player(i, 0) == CARD_NOCARD)
				|| (p_scraper->card_player(i, 1) == CARD_NOCARD)))
		{
			_nopponentsfolded++;					
		}
		if (p_scraper->card_player(i, 0) != CARD_NOCARD 
			&& p_scraper->card_player(i, 1) != CARD_NOCARD 
			&& current_players_bet == 0)
		{
			_nopponentschecking++;
		}
	}
	AssertRange(_nplayerscallshort,  0, k_max_number_of_opponents_at_full_ring_table);
	AssertRange(_nopponentsbetting,  0, k_max_number_of_opponents_at_full_ring_table);
	AssertRange(_nopponentsfolded,   0, k_max_number_of_opponents_at_full_ring_table);
	AssertRange(_nopponentschecking, 0, k_max_number_of_opponents_at_full_ring_table);
}
void CSymbolEngineRaisersCallers::CalculateNOpponentsCheckingBettingFolded()
{
	_nplayerscallshort  = 0;
	_nopponentsbetting  = 0;
	_nopponentsfolded   = 0;
	_nopponentschecking = 0;

  assert(p_tablemap->nchairs() <= k_max_number_of_players);
	for (int i=0; i<p_tablemap->nchairs(); i++)
	{
		double current_players_bet = p_symbol_engine_chip_amounts->currentbet(i);
		if (current_players_bet < RaisersBet()
      && p_table_state->_players[i].HasAnyCards())
		{
			_nplayerscallshort++;
		}
		if (i == USER_CHAIR)
		{
			// No opponent;
			// Nothing more to do
			continue;
		}
		if (current_players_bet > 0) 
		{
			_nopponentsbetting++;
		}
		// Players might have been betting, but folded, so no else for the if
		if ((p_symbol_engine_active_dealt_playing->playersdealtbits() & (1<<(i)))
        && !p_table_state->_players[i].HasAnyCards())	{
			_nopponentsfolded++;					
		}
		if (p_table_state->_players[i].HasAnyCards() 
			  && current_players_bet == 0) {
			_nopponentschecking++;
		}
	}
	AssertRange(_nplayerscallshort,  0, k_max_number_of_opponents_at_full_ring_table);
	// Using k_max_number_of_players instead of k_max_number_of_opponents_at_full_ring_table below,
	// as it might be that the user is not seated or user-chair not recognized
	AssertRange(_nopponentsbetting,  0, k_max_number_of_players);
	AssertRange(_nopponentsfolded,   0, k_max_number_of_players);
	AssertRange(_nopponentschecking, 0, k_max_number_of_players);
}
void CSymbolEngineChecksBetsFolds::CalculateNOpponentsCheckingBettingFolded() {
	_nplayerscallshort  = 0;
	_nopponentsbetting  = 0;
	_nopponentsfolded   = 0;
	_nopponentschecking = 0;
  assert(p_tablemap->nchairs() <= kMaxNumberOfPlayers);
	for (int i=0; i<p_tablemap->nchairs(); i++)	{
		double current_players_bet = p_table_state->Player(i)->_bet.GetValue();
		if (current_players_bet < RaisersBet()
        && p_table_state->Player(i)->HasAnyCards())	{
			_nplayerscallshort++;
		}
		if (i == p_engine_container->symbol_engine_userchair()->userchair()) {
			// No opponent;
			// Nothing more to do
			continue;
		}
		if (current_players_bet > 0) {
			_nopponentsbetting++;
		}
		// Players might have been betting, but folded, so no else for the if
		if ((p_engine_container->symbol_engine_active_dealt_playing()->playersdealtbits() & (1<<(i)))
        && !p_table_state->Player(i)->HasAnyCards())	{
			_nopponentsfolded++;					
		}
		if (p_table_state->Player(i)->HasAnyCards() 
			  && current_players_bet == 0) {
			_nopponentschecking++;
		}
	}
	AssertRange(_nplayerscallshort,  0, kMaxNumberOfOpponentsAtFullRingTable);
	// Using kMaxNumberOfPlayers instead of kMaxNumberOfOpponentsAtFullRingTable below,
	// as it might be that the user is not seated or user-chair not recognized
	AssertRange(_nopponentsbetting,  0, kMaxNumberOfPlayers);
	AssertRange(_nopponentsfolded,   0, kMaxNumberOfPlayers);
	AssertRange(_nopponentschecking, 0, kMaxNumberOfPlayers);
}