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

libkdegames/highscore

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

#include <kexthighscore_item.h>

Public Member Functions

 Score (ScoreType type=Won)
 
 ~Score ()
 
QVariant data (const QString &name) const
 
bool isTheWorst () const
 
bool operator< (const Score &score)
 
uint score () const
 
void setData (const QString &name, const QVariant &value)
 
void setScore (uint score)
 
void setType (ScoreType type)
 
ScoreType type () const
 

Friends

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

Detailed Description

This class contains data for a score.

You should not inherit from this class but reimplement the methods in Highscores.

Definition at line 178 of file kexthighscore_item.h.

Constructor & Destructor Documentation

KExtHighscore::Score::Score ( ScoreType  type = Won)

Definition at line 148 of file kexthighscore_item.cpp.

KExtHighscore::Score::~Score ( )

Definition at line 156 of file kexthighscore_item.cpp.

Member Function Documentation

QVariant KExtHighscore::Score::data ( const QString &  name) const
Returns
the data associated with the named Item.

Definition at line 159 of file kexthighscore_item.cpp.

bool KExtHighscore::Score::isTheWorst ( ) const
Returns
true if this is the worst possible score (ie the default argument of ScoreItem).

Definition at line 172 of file kexthighscore_item.cpp.

bool KExtHighscore::Score::operator< ( const Score &  score)

Comparison operator.

See also
Manager::isStrictlyLess

Definition at line 178 of file kexthighscore_item.cpp.

uint KExtHighscore::Score::score ( ) const
inline
Returns
the score value.

Equivalent to

data("score").toUInt()

.

Definition at line 212 of file kexthighscore_item.h.

void KExtHighscore::Score::setData ( const QString &  name,
const QVariant &  value 
)

Set the data associated with the named Item.

Note that the value should have the type of the default value of the Item.

Definition at line 165 of file kexthighscore_item.cpp.

void KExtHighscore::Score::setScore ( uint  score)
inline

Set the score value.

Equivalent to

setData("score", score)

.

Definition at line 219 of file kexthighscore_item.h.

void KExtHighscore::Score::setType ( ScoreType  type)
inline

Set the game type.

Definition at line 193 of file kexthighscore_item.h.

ScoreType KExtHighscore::Score::type ( ) const
inline
Returns
the game type.

Definition at line 188 of file kexthighscore_item.h.

Friends And Related Function Documentation

KDEGAMES_EXPORT QDataStream& operator<< ( QDataStream &  stream,
const Score &  score 
)
friend

Definition at line 183 of file kexthighscore_item.cpp.

KDEGAMES_EXPORT QDataStream& operator>> ( QDataStream &  stream,
Score &  score 
)
friend

Definition at line 190 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