summaryrefslogtreecommitdiffstats
path: root/klickety/highscores.cpp
blob: 62a2e28b9124209b6a3af414ec58a11226fbe1b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "highscores.h"

#include "base/factory.h"
#include "base/board.h"


using namespace KExtHighscore;

KLHighscores::KLHighscores()
{
    Item *item = createItem(ScoreDefault);
    setScoreItem(bfactory->bbi.width * bfactory->bbi.height + 1, item);
    addScoreItem("time", createItem(ElapsedTime));
}

bool KLHighscores::isStrictlyLess(const Score &s1, const Score &s2) const
{
    if ( s1.score()==s2.score() )
        return s1.data("time").toUInt()<s2.data("time").toUInt();
    return s1.score()>s2.score();
}

void KLHighscores::additionalQueryItems(KURL &url, const Score &s) const
{
    uint time = s.data("time").toUInt();
    addToQueryURL(url, "scoreTime", TQString::number(time));
}