KExtHighscore::Score Class Reference

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

#include <kexthighscore_item.h>

List of all members.

Public Member Functions

 Score (ScoreType type=Won)
 ~Score ()
ScoreType type () const
void setType (ScoreType type)
 Set the game type.
const QVariant & data (const QString &name) const
void setData (const QString &name, const QVariant &value)
 Set the data associated with the named Item.
uint score () const
void setScore (uint score)
 Set the score value.
bool isTheWorst () const
bool operator< (const Score &score)
 Comparison operator.

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.


Constructor & Destructor Documentation

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

Definition at line 144 of file kexthighscore_item.cpp.

References KExtHighscore::internal, KExtHighscore::ItemArray::item(), and KExtHighscore::ManagerPrivate::scoreInfos().

Here is the call graph for this function:

KExtHighscore::Score::~Score  ) 
 

Definition at line 152 of file kexthighscore_item.cpp.


Member Function Documentation

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

Returns:
the data associated with the named Item.

Definition at line 155 of file kexthighscore_item.cpp.

Referenced by KExtHighscore::ItemArray::write().

bool KExtHighscore::Score::isTheWorst  )  const
 

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

Definition at line 168 of file kexthighscore_item.cpp.

References score().

Here is the call graph for this function:

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

Comparison operator.

See also:
Manager::isStrictlyLess

Definition at line 174 of file kexthighscore_item.cpp.

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

Here is the call graph for this function:

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 operator<().

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

References type().

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

Here is the call graph for this function:

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.

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

Set the game type.

Definition at line 190 of file kexthighscore_item.h.

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().


Friends And Related Function Documentation

friend class MultiplayerScores [friend]
 

Definition at line 238 of file kexthighscore_item.h.

QDataStream& operator<< QDataStream &  stream,
const Score score
[friend]
 

Definition at line 179 of file kexthighscore_item.cpp.

QDataStream& operator>> QDataStream &  stream,
Score score
[friend]
 

Definition at line 186 of file kexthighscore_item.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Aug 23 18:06:32 2006 for libkdegames by  doxygen 1.4.6