本文整理汇总了C++中Card::ToShortString方法的典型用法代码示例。如果您正苦于以下问题:C++ Card::ToShortString方法的具体用法?C++ Card::ToShortString怎么用?C++ Card::ToShortString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card::ToShortString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PerformMovement
bool TableauToFoundation::PerformMovement(BoardLayout* layout)
{
assert(layout);
bool movement_performed;
PileSet* pile_set = layout->GetPileSet();
assert(pile_set);
Card* card = NULL;
Tableau* tableau = (*(pile_set->GetTableaus()))[m_origin_tableau];
if(!tableau || (tableau->Size() == 0)) {
movement_performed = false;
}
else {
card = tableau->BottomCard();
Foundation* foundation = pile_set->GetFoundation(card->GetSuit());
if(!card || !foundation || !foundation->Push(card)) {
// QUIT
if(!card) {
std::cout << "NO CARD IN TABLEAU:" << card->ToShortString();
}
else {
std::cout << "CARD:" << card->ToShortString();
}
//
movement_performed = false;
}
else {
tableau->Pop();
movement_performed = true;
}
}
m_complete = false;
return movement_performed;
}
示例2: DrawTableausInLine
void InterfaceDrawVisitor::DrawTableausInLine(std::vector<Tableau*>* tableaus,
const uint8_t& line) const
{
assert(tableaus);
for (auto tableau_it : *tableaus) {
Card* card = tableau_it->CardAt(line);
if(card) {
std::cout.width(6);
std::cout << std::right << card->ToShortString();
}
else {
std::cout.width(6);
std::cout << std::right << "";
}
}
}