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

Parker Coates parker.coates at gmail.com
Thu May 1 03:51:51 CEST 2008


2008/4/30 Matt Williams <matt at milliams.com>:
>  Just an update...
>
>  I've committed the current version to SVN playground, it can be found at
>  http://websvn.kde.org/trunk/playground/games/kscoremanager/. Hopefully by
>  tomorrow the doxygen generator will have run and so documentation will be
>  available at
>  http://api.kde.org/playground-api/games-apidocs/kscoremanager/html/index.html.
>  There's still no .cpp code, just headers.

It looks really good! Here are some comments:

- It's missing an "int numberOfScores() const" method. I don't really
love that name, but I haven't been able to come up with anything much
better. Maybe "scoreBoardLength"?

- As you mentioned the Comment logic and
KScoreManager::ScoreDisplayFlags should probably move to the UI class
as they affect only presentation.

- Instead of

 KScoreBoardDialog board();
 board.show(KScoreDialog::HighlightLastScore | KScoreDialog::DisplayMessage);

I'd prefer

 KScoreBoardDialog board(KScoreDialog::HighlightLastScore |
KScoreDialog::DisplayMessage);
 board.show();

as these seem like properties of the dialog that are unlikely to
change during it's lifetime.

- Dmitry's "leader board" style dialog should probably be it's own UI
class (KLevelScoreDialog?), instead of an option passed to
KScoreBoardDialog. It would certainly keep the implementation a lot
cleaner.

- Does calling "submitName( QString() )" submit a score with an empty
name? Use the presupplied player name if one exists? Use
"i18n("Anonymous")"? Or does it reject the current score? If not, will
there be a way to cancel the last submitted score? I'm not sure that
that's necessary, but someone did ask for it earlier.

- What does KScoreManager do if "submitName" is never called? If a new
score is added while "isWaitingForName()" is true, what do we do about
the last score? I guess these are situations that should never occur
in a properly coded application, but they should probably be handled
properly regardless.

Anyway, it seems like things are shaping up nicely. I can't wait to
see some implementation to go with this API.

Parker


More information about the kde-games-devel mailing list