Esempio n. 1
0
void KCard::animate( QPointF pos, qreal z, qreal rotation, bool faceUp, bool raised, int duration )
{
    stopAnimation();

    if ( duration > 0
         && ( qAbs( pos.x() - x() ) > 2
              || qAbs( pos.y() - y() ) > 2
              || qAbs( rotation - this->rotation() ) > 2
              || faceUp != d->faceUp ) )
    {
        if ( raised )
            raise();

        d->destZ = z;
        d->faceUp = faceUp;

        d->animation = new KCardAnimation( d, duration, pos, rotation, faceUp );
        connect( d->animation, SIGNAL(finished()), SLOT(stopAnimation()) );
        d->animation->start();
        emit animationStarted( this );
    }
    else
    {
        setPos( pos );
        setZValue( z );
        setRotation( rotation );
        setFaceUp( faceUp );
    }
}
Esempio n. 2
0
// constructor
// initialize card to a reasonable value.
// the card is initially not visible to any player at the table.
CCard::CCard(void)
{
	setFrontTexture(NULL);
	setBackTexture(NULL);
	setRank(Ace);
	setSuit(Hearts);
	// for debug - set to true
	setFaceUp(false);
	setSpriteLength(0);
	setSpriteWidth(0);
	setLocation(0, 0);
	setFileName(L"");

	return;
}