libkdegames Library API Documentation

KExtHighscore::Score Class Reference

This class contains data for a score. More...

#include <kexthighscore_item.h>

Collaboration diagram for KExtHighscore::Score:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Friends

class MultiplayerScores
QDataStream & operator<< (QDataStream &stream, const Score &score)
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 175 of file kexthighscore_item.h.


Member Function Documentation

ScoreType KExtHighscore::Score::type (   )  const [inline]
 

Returns:
the game type.

Definition at line 185 of file kexthighscore_item.h.

Referenced by KExtHighscore::MultiplayerScores::addScore(), KExtHighscore::operator<<(), setData(), KExtHighscore::ManagerPrivate::submitScore(), and KExtHighscore::PlayerInfos::submitScore().

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

Set the game type.

Definition at line 190 of file kexthighscore_item.h.

const QVariant & KExtHighscore::Score::data (  const QString &  name  )  const
 

Returns:
the data associated with the named Item.

Definition at line 157 of file kexthighscore_item.cpp.

References QMap::contains().

Referenced by KExtHighscore::PlayerInfos::submitScore(), and KExtHighscore::ItemArray::write().

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 163 of file kexthighscore_item.cpp.

References QMap::contains(), QVariant::type(), and type().

Referenced by KExtHighscore::ItemArray::read(), and KExtHighscore::ManagerPrivate::submitScore().

uint KExtHighscore::Score::score (   )  const [inline]
 

Returns:
the score value.
Equivalent to
data("score").toUInt()
.

Definition at line 209 of file kexthighscore_item.h.

Referenced by KExtHighscore::MultiplayerScores::addScore(), KExtHighscore::Manager::isStrictlyLess(), isTheWorst(), and KExtHighscore::PlayerInfos::submitScore().

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

Set the score value.

Equivalent to

setData("score", score)
.

Definition at line 216 of file kexthighscore_item.h.

Referenced by KExtHighscore::PlayerInfos::submitScore().

bool KExtHighscore::Score::isTheWorst (   )  const
 

Returns:
true if this is the worst possible score (ie the default argument of ScoreItem).

Definition at line 170 of file kexthighscore_item.cpp.

References score().

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

Comparison operator.

See also:
Manager::isStrictlyLess

Definition at line 176 of file kexthighscore_item.cpp.

References KExtHighscore::internal, KExtHighscore::Manager::isStrictlyLess(), and KExtHighscore::ManagerPrivate::manager.


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.4.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 9 09:38:37 2005 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003