• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames/highscore

KExtHighscore::MultiplayerScores

KExtHighscore::MultiplayerScores Class Reference

#include <kexthighscore_item.h>

List of all members.


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.


Public Member Functions

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

Friends

KDEGAMES_EXPORT QDataStream & operator<< (QDataStream &stream, const MultiplayerScores &score)
KDEGAMES_EXPORT QDataStream & operator>> (QDataStream &stream, MultiplayerScores &score)

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

KDEGAMES_EXPORT QDataStream& operator<< ( QDataStream &  stream,
const MultiplayerScores &  score 
) [friend]

Definition at line 307 of file kexthighscore_item.cpp.

KDEGAMES_EXPORT QDataStream& operator>> ( QDataStream &  stream,
MultiplayerScores &  score 
) [friend]

Definition at line 314 of file kexthighscore_item.cpp.


The documentation for this class was generated from the following files:
  • kexthighscore_item.h
  • kexthighscore_item.cpp

libkdegames/highscore

Skip menu "libkdegames/highscore"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal