• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames/kggzmod

KGGZMod::Statistics

KGGZMod::Statistics Class Reference

#include <statistics.h>

List of all members.


Detailed Description

Statistics of a player in an online game.

Depending on the game type, a game might support a simple record-style statistics, for which the wins, losses, ties and forfeits can be queried.

Other games support highscore, ranking and rating values.

Which type is supported by the current game can be queried on the statistics object as well.

There is no constructor for the class since statistics can only be found on actual Player objects.

Author:
Josef Spillner (josef@ggzgamingzone.org)

Definition at line 49 of file statistics.h.


Public Member Functions

 ~Statistics ()
int wins () const
int losses () const
int ties () const
int forfeits () const
int rating () const
int ranking () const
int highscore () const
bool hasRecord () const
bool hasRating () const
bool hasRanking () const
bool hasHighscore () const

Friends

class ModulePrivate

Constructor & Destructor Documentation

Statistics::~Statistics (  ) 

Definition at line 44 of file statistics.cpp.


Member Function Documentation

int Statistics::wins (  )  const

The number of times a player has won this game.

The number of wins are only valid if hasRecord returns true.

Returns:
number of wins

Definition at line 49 of file statistics.cpp.

int Statistics::losses (  )  const

The number of times a player has lost this game.

The number of losses are only valid if hasRecord returns true.

Returns:
number of losses

Definition at line 54 of file statistics.cpp.

int Statistics::ties (  )  const

The number of times a player has tied with another one.

This is when the game ended and there was no clear winner.

The number of ties are only valid if hasRecord returns true.

Returns:
number of ties

Definition at line 59 of file statistics.cpp.

int Statistics::forfeits (  )  const

The number of times a player has forfeited.

This is when a player leaves the game without properly abandoning the seat.

The number of forfeits are only valid if hasRecord returns true.

Returns:
number of forfeits

Definition at line 64 of file statistics.cpp.

int Statistics::rating (  )  const

The rating of a player.

This is the rounded number of a calculation which depends on the game type. For example, chess games might use Elo-style ratings.

The rating is only valid if hasRating returns true.

Returns:
rating for the player in this game type

Definition at line 69 of file statistics.cpp.

int Statistics::ranking (  )  const

The ranking of a player.

This is the position in a ranking list, where 1 is the 1st place and all others are below.

The ranking is only valid if hasRanking returns true.

Returns:
ranking for the player in this game type

Definition at line 74 of file statistics.cpp.

int Statistics::highscore (  )  const

The highscore of a player.

In highscore-based games, this determines the best for each player.

The highscore is only valid if hasHighscore returns true.

Returns:
highscore for the player in this game type

Definition at line 79 of file statistics.cpp.

bool Statistics::hasRecord (  )  const

Determines if a game supports records.

Returns:
true if it supports records, false otherwise

Definition at line 84 of file statistics.cpp.

bool Statistics::hasRating (  )  const

Determines if a game supports ratings.

Returns:
true if it supports ratings, false otherwise

Definition at line 89 of file statistics.cpp.

bool Statistics::hasRanking (  )  const

Determines if a game supports rankings.

Returns:
true if it supports rankings, false otherwise

Definition at line 94 of file statistics.cpp.

bool Statistics::hasHighscore (  )  const

Determines if a game supports highscores.

Returns:
true if it supports highscores, false otherwise

Definition at line 99 of file statistics.cpp.


Friends And Related Function Documentation

friend class ModulePrivate [friend]

Definition at line 51 of file statistics.h.


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

libkdegames/kggzmod

Skip menu "libkdegames/kggzmod"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal