• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames/highscore

  • KExtHighscore
  • MultiplayerScores
Public Member Functions | Friends | List of all members
KExtHighscore::MultiplayerScores Class Reference

#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

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
This file is part of the KDE documentation.
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.

libkdegames/highscore

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

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal