|
wavelength 1.0.0
|
The rating of one player of an online game, and the results that rate the player afterwards. More...
#include <ratingstat.h>
Public Member Functions | |
| void | Set (const NetLaunchpadPlayer *pPlayer) |
| Copy the identifier, the rating, and the record of a player of the session. | |
| int | Rating () const |
| Report the rating without the bonus of a player past the first games. | |
| bool | IsProvisional () const |
| Report whether the player has played fewer than kProvisionalGames games. | |
| void | Rate (int nId, const std::vector< RatingStat > *pStats) |
| Rate a player from the scores of a game. | |
| int | GetGames () const |
| int | GetId () const |
| int | GetOpponents () const |
| int | GetPoints () const |
| int | GetRating () const |
| void | SetScore (int nScore) |
| float | GetWins () const |
Static Public Member Functions | |
| static float | Outcome (int nScore, int nOpponentScore) |
| Report the outcome of a game for a player. | |
| static float | ExpectedScore (int nDifference) |
| Report the score a player expects against an opponent from the difference of the ratings. | |
| static float | RatingDifference (float fScore) |
| Report the difference of ratings that makes a player expect a score, inverting ExpectedScore() by interpolation. | |
Static Public Attributes | |
| static constexpr int | kProvisionalGames = 16 |
| The games below which a player's rating comes from the average of the opponents. | |
| static constexpr int | kDifferenceCount = 51 |
| The number of entries of sDifferences. | |
| static int | sDifferences [kDifferenceCount] |
| The differences of ratings that make a player expect scores of 0.5, 0.51, and so on to 1. | |
The rating of one player of an online game, and the results that rate the player afterwards.
The RTTI includes the name, which the type information of the standard library vector of the type records. The record is 0x1c bytes. A rating at least 1000000 marks a player who has played the first games, and Rating() takes the bonus off.
| void RatingStat::Set | ( | const NetLaunchpadPlayer * | pPlayer | ) |
Copy the identifier, the rating, and the record of a player of the session.
| pPlayer | The player. |
| int RatingStat::Rating | ( | ) | const |
Report the rating without the bonus of a player past the first games.
| bool RatingStat::IsProvisional | ( | ) | const |
Report whether the player has played fewer than kProvisionalGames games.
| void RatingStat::Rate | ( | int | nId, |
| const std::vector< RatingStat > * | pStats ) |
Rate a player from the scores of a game.
The routine copies the stats of the player into this one, rates the player against every other player, and clamps the rating from 0 to 90000 before it adds the bonus of a player past the first games. A provisional rating averages the opponents' ratings and moves them by the share of games won. Another rating moves by an Elo step against each opponent.
| nId | The player. |
| pStats | The stats of every player of the game, with their scores. |
|
static |
Report the outcome of a game for a player.
| nScore | The player's score. |
| nOpponentScore | The opponent's score. |
|
static |
Report the score a player expects against an opponent from the difference of the ratings.
| nDifference | The player's rating less the opponent's. |
|
static |
Report the difference of ratings that makes a player expect a score, inverting ExpectedScore() by interpolation.
| fScore | The score. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| nScore | The score of the game being rated. |
|
inline |
|
staticconstexpr |
The games below which a player's rating comes from the average of the opponents.
|
staticconstexpr |
The number of entries of sDifferences.
|
static |
The differences of ratings that make a player expect scores of 0.5, 0.51, and so on to 1.