[Kde-games-devel] A new highscore manager - KScoreManager

Parker Coates parker.coates at gmail.com
Tue Apr 29 04:59:16 CEST 2008


2008/4/28 Matt Williams <matt at milliams.com>:
>  Attached is the current API for the class (named KScoreManager).
>
>  Comments? Complaints? Insults?

Hello Matt,

I'm glad to see that you're giving the high score system some
attention. Whatever you decided to do, I'm sure it'll come out better
in the long run. After reading your header, I have a couple thoughts.

First, I think it'd be nice to have a static setting for the number of
scores to to save and display. I got thinking about this because there
are options to make the score table as wide as you want, but the
length is constant. I realise ten is a pretty reasonable default, but
it think it'd be neat to be able to ask for only 5 scores or maybe as
many as thirty. If it turns out to be a pain to implement than it
might not be worth the effort, but if we're rewriting the thing from
scratch now would be the time to try it.

Second, it'd be great to make the KScoreManager as useful as possible
to those implementing other score UIs. I assume you plan to use a
KScoreDialog very similar to the one we already have to display the
scores, but it might be a good idea to consider other options. I don't
think anyone has done so yet, but I know there was talk at one time of
implementing a highscore listing directly on the game canvas. In such
a case, it'd be convenient to leverage the KScoreManager code wherever
possible. Some potentially useful functions could be:

  - A form of addScore that didn't show the score dialog.
  - ScoreInfo getScore( int index, const QByteArray& groupKey )
  - QList< ScoreInfo > getScores( const QByteArray& groupKey )
  - QStringList scoreGroupNames() //This will probably need to be more
complex in light of the recent i18n changes.
  - etc.

Anyway, those are just some thoughts. I'm interested to see how this turns out.

Parker


More information about the kde-games-devel mailing list