libkdegames/kggzmod
KGGZMod::Statistics Class Reference
#include <statistics.h>
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.
Definition at line 49 of file statistics.h.
Public Member Functions | |
| int | forfeits () const |
| bool | hasHighscore () const |
| bool | hasRanking () const |
| bool | hasRating () const |
| bool | hasRecord () const |
| int | highscore () const |
| int | losses () const |
| int | ranking () const |
| int | rating () const |
| int | ties () const |
| int | wins () const |
| ~Statistics () | |
Constructor & Destructor Documentation
| Statistics::~Statistics | ( | ) |
Definition at line 44 of file statistics.cpp.
Member Function Documentation
| 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.
| 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.
| 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::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::hasRecord | ( | ) | const |
Determines if a game supports records.
- Returns:
- true if it supports records, false otherwise
Definition at line 84 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.
| 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::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::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::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::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.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference