• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

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

#include <kexthighscore_item.h>

Public Member Functions

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

Friends

TQDataStream & operator<< (TQDataStream &stream, const MultiplayerScores &score)
TQDataStream & operator>> (TQDataStream &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 267 of file kexthighscore_item.h.

Constructor & Destructor Documentation

◆ MultiplayerScores()

KExtHighscore::MultiplayerScores::MultiplayerScores ( )

Definition at line 196 of file kexthighscore_item.cpp.

◆ ~MultiplayerScores()

KExtHighscore::MultiplayerScores::~MultiplayerScores ( )

Definition at line 199 of file kexthighscore_item.cpp.

Member Function Documentation

◆ addScore()

void KExtHighscore::MultiplayerScores::addScore ( uint player,
const Score & score )

Add the score of player.

Definition at line 227 of file kexthighscore_item.cpp.

◆ clear()

void KExtHighscore::MultiplayerScores::clear ( )

Clear all scores.

Definition at line 202 of file kexthighscore_item.cpp.

◆ setName()

void KExtHighscore::MultiplayerScores::setName ( uint player,
const TQString & name )

Set the name of player.

Definition at line 222 of file kexthighscore_item.cpp.

◆ setPlayerCount()

void KExtHighscore::MultiplayerScores::setPlayerCount ( uint nb)

Set the number of players and clear the scores.

Definition at line 215 of file kexthighscore_item.cpp.

◆ show()

void KExtHighscore::MultiplayerScores::show ( TQWidget * parent)

Show scores.

Definition at line 241 of file kexthighscore_item.cpp.

Friends And Related Symbol Documentation

◆ operator<<

TQDataStream & operator<< ( TQDataStream & stream,
const MultiplayerScores & score )
friend

Definition at line 298 of file kexthighscore_item.cpp.

◆ operator>>

TQDataStream & operator>> ( TQDataStream & stream,
MultiplayerScores & score )
friend

Definition at line 305 of file kexthighscore_item.cpp.


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

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.15.0
This website is maintained by Timothy Pearson.