libkdegames/highscore
#include <kexthighscore_item.h>
Public Member Functions | |
MultiplayerScores () | |
~MultiplayerScores () | |
void | addScore (uint player, const Score &score) |
void | clear () |
void | setName (uint player, const QString &name) |
void | setPlayerCount (uint nb) |
void | show (QWidget *parent) |
Friends | |
KDEGAMES_EXPORT QDataStream & | operator<< (QDataStream &stream, const MultiplayerScores &score) |
KDEGAMES_EXPORT QDataStream & | operator>> (QDataStream &stream, MultiplayerScores &score) |
Detailed Description
This class is used to store and show scores for multiplayer games.
Example of use: Initialize the class:
KExtHighscore::MultiScore ms(2); ms.setPlayerName(0, "player 1"); ms.setPlayerName(1, "player 2");
At the end of each game, add the score of each players:
KExtHighscore::Score score(KExtHighscore::Won); score.setScore(100); ms.addScore(0, score); score.setType(KExtHighscore::Lost); score.setScore(20); ms.addScore(1, score);
Definition at line 271 of file kexthighscore_item.h.
Constructor & Destructor Documentation
KExtHighscore::MultiplayerScores::MultiplayerScores | ( | ) |
Definition at line 200 of file kexthighscore_item.cpp.
KExtHighscore::MultiplayerScores::~MultiplayerScores | ( | ) |
Definition at line 203 of file kexthighscore_item.cpp.
Member Function Documentation
void KExtHighscore::MultiplayerScores::addScore | ( | uint | player, |
const Score & | score | ||
) |
Add the score of player.
Definition at line 231 of file kexthighscore_item.cpp.
void KExtHighscore::MultiplayerScores::clear | ( | ) |
Clear all scores.
Definition at line 206 of file kexthighscore_item.cpp.
void KExtHighscore::MultiplayerScores::setName | ( | uint | player, |
const QString & | name | ||
) |
Set the name of player.
Definition at line 226 of file kexthighscore_item.cpp.
void KExtHighscore::MultiplayerScores::setPlayerCount | ( | uint | nb | ) |
Set the number of players and clear the scores.
Definition at line 219 of file kexthighscore_item.cpp.
void KExtHighscore::MultiplayerScores::show | ( | QWidget * | parent | ) |
Show scores.
Definition at line 245 of file kexthighscore_item.cpp.
Friends And Related Function Documentation
|
friend |
Definition at line 307 of file kexthighscore_item.cpp.
|
friend |
Definition at line 314 of file kexthighscore_item.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:46 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.