本文整理汇总了C++中Pile::cardsLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ Pile::cardsLeft方法的具体用法?C++ Pile::cardsLeft怎么用?C++ Pile::cardsLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pile
的用法示例。
在下文中一共展示了Pile::cardsLeft方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MoveHint
MoveHint *YukonSolver::translateMove( const MOVE &m )
{
Pile *frompile = 0;
frompile = deal->store[m.from];
Card *card = frompile->at( frompile->cardsLeft() - m.card_index - 1);
if ( m.totype == O_Type )
{
Pile *target = 0;
Pile *empty = 0;
for (int i = 0; i < 4; i++) {
Card *c = deal->target[i]->top();
if (c) {
if ( c->suit() == card->suit() )
{
target = deal->target[i];
break;
}
} else if ( !empty )
empty = deal->target[i];
}
if ( !target )
target = empty;
return new MoveHint( card, target, m.pri );
} else {
return new MoveHint( card, deal->store[m.to], m.pri );
}
}
示例2: MoveHint
MoveHint *IdiotSolver::translateMove( const MOVE &m )
{
if ( m.from >=4 )
return 0;
Pile *frompile = deal->m_play[m.from];
Card *card = frompile->at( frompile->cardsLeft() - m.card_index - 1);
Q_ASSERT( card );
Pile *target = 0;
if ( m.to == 5 )
target = deal->m_away;
else
target = deal->m_play[m.to];
return new MoveHint( card, target, m.pri );
}