当前位置: 首页>>代码示例>>C++>>正文


C++ Card::GetSuitString方法代码示例

本文整理汇总了C++中Card::GetSuitString方法的典型用法代码示例。如果您正苦于以下问题:C++ Card::GetSuitString方法的具体用法?C++ Card::GetSuitString怎么用?C++ Card::GetSuitString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Card的用法示例。


在下文中一共展示了Card::GetSuitString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DealCommunityCards

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);
	}
}
开发者ID:robertjmartin,项目名称:poker,代码行数:11,代码来源:HoldEmTable.cpp

示例2: CollectBlindsAndDeal

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 );
}
开发者ID:robertjmartin,项目名称:poker,代码行数:45,代码来源:HoldEmTable.cpp


注:本文中的Card::GetSuitString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。