本文整理汇总了C++中CCard::GetCardFaceNum方法的典型用法代码示例。如果您正苦于以下问题:C++ CCard::GetCardFaceNum方法的具体用法?C++ CCard::GetCardFaceNum怎么用?C++ CCard::GetCardFaceNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCard
的用法示例。
在下文中一共展示了CCard::GetCardFaceNum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCardSpriteByCompsiteNum
SpriteFrame* CClientApp::getCardSpriteByCompsiteNum(uint16_t nNum )
{
CCard tc ;
tc.RsetCardByCompositeNum(nNum);
std::string spriteValue ;
uint8_t nType = 0 ;
switch ( tc.GetType() )
{
case CCard::eCard_Diamond:
nType = 4 ;
break;
case CCard::eCard_Heart:
nType = 2 ;
break;
case CCard::eCard_Sword:
nType = 1 ;
break;
case CCard::eCard_Club:
nType = 3 ;
break;
default:
break;
}
if ( nType == 0 || tc.GetCardCompositeNum() == 0 )
{
return nullptr ;
}
if ( tc.GetCardFaceNum(true) <= 9 )
{
spriteValue = String::createWithFormat("card-%d0%d.png",nType,tc.GetCardFaceNum(true))->getCString();
}
else
{
spriteValue = String::createWithFormat("card-%d0%c.png",nType,'a'+ tc.GetCardFaceNum(true)%10)->getCString();
}
return SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteValue.c_str());
}
示例2: getAction
CTaxasAINode::eAIActionType CTaxasRobotBrain::getAction(unsigned int nMostBetTimesBlind, int& addTimesBlind, char nDemondRound )
{
unsigned char nRound = 0 ;
switch ( m_tPeerCard.getAllCardCnt() )
{
case 2:
{
nRound = 0 ;
}
break;
case 5:
{
nRound = 1 ;
}
break;
case 6:
{
nRound = 2 ;
}
break;
case 7:
{
nRound = 3 ;
}
break;
default:
assert(0 && "receive card error ,pls check you logic" );
return CTaxasAINode::eAIAct_Pass;
}
if ( nDemondRound != -1 )
{
if ( nRound >= nDemondRound )
{
nRound = nDemondRound ;
}
else
{
assert(0 && "receieved cards not enough for your demond round " );
}
}
unsigned char nCardType = 0 ;
unsigned char nKeyCardFaceValue = 0 ;
unsigned char nContributeCnt = 0 ;
if ( 0 == nRound )
{
nContributeCnt = 2 ;
CCard left , right ;
unsigned char vHoldCard[2] = {m_tPeerCard.GetPrivateCard(0),m_tPeerCard.GetPrivateCard(1)} ;
left.RsetCardByCompositeNum(vHoldCard[0]);
right.RsetCardByCompositeNum(vHoldCard[1]);
nKeyCardFaceValue = left.GetCardFaceNum(true) > right.GetCardFaceNum(true) ? left.GetCardFaceNum(true) : right.GetCardFaceNum(true) ;
if ( left.GetCardFaceNum() == right.GetCardFaceNum() )
{
nCardType = CTaxasPokerPeerCard::eCard_YiDui ;
}
else if ( left.GetType() == right.GetType() )
{
nCardType = CTaxasPokerPeerCard::eCard_TongHua ;
}
else if ( abs(left.GetCardFaceNum() - right.GetCardFaceNum()) == 1 )
{
nCardType = CTaxasPokerPeerCard::eCard_ShunZi ;
}
else
{
nCardType = CTaxasPokerPeerCard::eCard_GaoPai ;
}
}
else
{
nCardType = m_tPeerCard.GetCardTypeForRobot(nContributeCnt,nKeyCardFaceValue);
}
return m_tAiCore.getAction(nRound,nCardType,nContributeCnt,nKeyCardFaceValue,nMostBetTimesBlind,addTimesBlind) ;
}