libkdegames Library API Documentation

KExtHighscore::MultiplayerScores Class Reference

This class is used to store and show scores for multiplayer games. More...

#include <kexthighscore_item.h>

List of all members.

Public Member Functions

void setPlayerCount (uint nb)
void setName (uint player, const QString &name)
void addScore (uint player, const Score &score)
void clear ()
void show (QWidget *parent)

Friends

QDataStreamoperator<< (QDataStream &stream, const MultiplayerScores &score)
QDataStreamoperator>> (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 266 of file kexthighscore_item.h.


Member Function Documentation

void KExtHighscore::MultiplayerScores::setPlayerCount uint  nb  ) 
 

Set the number of players and clear the scores.

Definition at line 215 of file kexthighscore_item.cpp.

References clear().

void KExtHighscore::MultiplayerScores::setName uint  player,
const QString name
 

Set the name of player.

Definition at line 222 of file kexthighscore_item.cpp.

void KExtHighscore::MultiplayerScores::addScore uint  player,
const Score score
 

Add the score of player.

Definition at line 227 of file kexthighscore_item.cpp.

References KExtHighscore::Score::setData().

void KExtHighscore::MultiplayerScores::clear  ) 
 

Clear all scores.

Definition at line 202 of file kexthighscore_item.cpp.

Referenced by setPlayerCount().

void KExtHighscore::MultiplayerScores::show QWidget parent  ) 
 

Show scores.

Definition at line 241 of file kexthighscore_item.cpp.

References QValueVector::end().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkdegames Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 21 12:08:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003