/usr/include/kggzmod/statistics.h is in libkdegames-dev 4:4.8.2-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | /*
This file is part of the kggzmod library.
Copyright (c) 2005 - 2007 Josef Spillner <josef@ggzgamingzone.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KGGZMOD_STATISTICS_H
#define KGGZMOD_STATISTICS_H
#include "kggzmod_export.h"
namespace KGGZMod
{
class StatisticsPrivate;
/**
* @short 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 \ref wins, \ref losses,
* \ref ties and \ref forfeits can be queried.
*
* Other games support \ref highscore, \ref ranking and
* \ref 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 \ref Player objects.
*
* @author Josef Spillner (josef@ggzgamingzone.org)
*/
class KGGZMOD_EXPORT Statistics
{
friend class ModulePrivate;
public:
~Statistics();
/**
* The number of times a player has won this game.
*
* The number of wins are only valid if \ref hasRecord returns \b true.
*
* @return number of wins
*/
int wins() const;
/**
* The number of times a player has lost this game.
*
* The number of losses are only valid if \ref hasRecord returns \b true.
*
* @return number of losses
*/
int losses() 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 \ref hasRecord returns \b true.
*
* @return number of ties
*/
int ties() 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 \ref hasRecord returns \b true.
*
* @return number of forfeits
*/
int forfeits() 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 \ref hasRating returns \b true.
*
* @return rating for the player in this game type
*/
int rating() 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 \ref hasRanking returns \b true.
*
* @return ranking for the player in this game type
*/
int ranking() const;
/**
* The highscore of a player.
*
* In highscore-based games, this determines the best for each player.
*
* The highscore is only valid if \ref hasHighscore returns \b true.
*
* @return highscore for the player in this game type
*/
int highscore() const;
/**
* Determines if a game supports records.
*
* @return \b true if it supports records, \b false otherwise
*/
bool hasRecord() const;
/**
* Determines if a game supports ratings.
*
* @return \b true if it supports ratings, \b false otherwise
*/
bool hasRating() const;
/**
* Determines if a game supports rankings.
*
* @return \b true if it supports rankings, \b false otherwise
*/
bool hasRanking() const;
/**
* Determines if a game supports highscores.
*
* @return \b true if it supports highscores, \b false otherwise
*/
bool hasHighscore() const;
private:
Statistics();
StatisticsPrivate *d;
void init(StatisticsPrivate *x);
};
}
#endif
|