Logo Search packages:      
Sourcecode: schafkopf version File versions  Download package

bool Card::operator< ( Card c  ) 

this operator< is not quite correct, it just tells wether ass is bigger than 10 or 10 is bigger than king, but does not care for color or what is currently played. So it does not care for Wenz or Solo's. it is used in Game::highesCard

Definition at line 126 of file card.cpp.

References card().

    // TODO: anyone a better idea?
    int a[] = {Card::SAU, Card::ZEHN, Card::KOENIG, Card::OBER, Card::UNTER, Card::NEUN, Card::ACHT, Card::SIEBEN};
    int i = 0;
    int pos = 0;
    for( ;i<(sizeof(a)/sizeof(int));i++)
        if( a[i] == this->card() )
            pos = i;
        if( a[i] == c->card() )
            return i < pos ? false : true;

    return false;

Generated by  Doxygen 1.6.0   Back to index