本文整理汇总了C++中Card::flipTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Card::flipTo方法的具体用法?C++ Card::flipTo怎么用?C++ Card::flipTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card::flipTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newCardsPossible
Card *Fortyeight::newCards()
{
if (Deck::deck()->isEmpty() && lastdeal)
return 0;
if (pile->top() && pile->top()->animated())
return pile->top();
if (Deck::deck()->isEmpty())
{
lastdeal = true;
while (!pile->isEmpty())
{
Card *c = pile->at(pile->cardsLeft()-1);
c->stopAnimation();
Deck::deck()->add(c, true);
}
}
Card *c = Deck::deck()->nextCard();
pile->add(c, true);
c->stopAnimation();
qreal x = c->realX();
qreal y = c->realY();
c->setPos( Deck::deck()->pos() );
c->flipTo(x, y, DURATION_FLIP );
takeState();
considerGameStarted();
if ( Deck::deck()->isEmpty() && lastdeal )
emit newCardsPossible( false );
return c;
}
示例2: redeal
void Klondike::deal3()
{
int draw;
if ( EasyRules ) {
draw = 1;
} else {
draw = 3;
}
pile->clearSpread();
if (deck->isEmpty())
{
redeal();
return;
}
// move the cards back on the deck, so we can have three new
for (int i = 0; i < pile->cardsLeft(); ++i) {
pile->at(i)->move(pile->x(), pile->y());
}
for (int flipped = 0; flipped < draw ; ++flipped) {
Card *item = deck->nextCard();
if (!item) {
kdDebug(11111) << "deck empty!!!\n";
return;
}
pile->add(item, true, true); // facedown, nospread
if (flipped < draw - 1)
pile->addSpread(item);
// move back to flip
item->move(deck->x(), deck->y());
item->flipTo( int(pile->x()) + pile->dspread() * (flipped), int(pile->y()), 8 * (flipped + 1) );
}
}