本文整理汇总了C++中CardSet::evaluateRanksLow2to7方法的典型用法代码示例。如果您正苦于以下问题:C++ CardSet::evaluateRanksLow2to7方法的具体用法?C++ CardSet::evaluateRanksLow2to7怎么用?C++ CardSet::evaluateRanksLow2to7使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CardSet
的用法示例。
在下文中一共展示了CardSet::evaluateRanksLow2to7方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: combo
// This one is not fully optimized
PokerEvaluation CardSet::evaluateRanksLow2to7() const
{
PokerEvaluation high;
PokerEvaluation h;
// if there are five or fewer cards, we just evaluate the high,
// fix the wheel, and take the complement
switch (size())
{
case 0:
case 1:
case 2:
case 3:
case 4:
high = evaluateHighRanks();
break;
case 5:
high = evaluateHighRanks();
high.fixWheel2to7(rankMask());
break;
default:
// this is a slow way to handle the general case.
// TODO: specialize the code for the 6 and 7 card cases.
vector<Card> cards = this->cards();
combinations combo(size(), FULL_HAND_SIZE);
PokerEvaluation best;
do
{
CardSet candidate;
for (size_t i=0; i<static_cast<size_t>(FULL_HAND_SIZE); i++)
candidate.insert(cards[combo[i]]);
PokerEvaluation e = candidate.evaluateRanksLow2to7();
if (e > best)
best = e;
}
while (combo.next());
return best;
}
high.flip();
return high;
}