Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
gpg::ScoreSummary
#include <score_summary.h>
Une structure de données unique qui vous permet d'accéder à un résumé des informations sur les scores.
Résumé
Fonctions publiques
ApproximateNumberOfScores
uint64_t ApproximateNumberOfScores() const
Renvoie le nombre approximatif de scores sur la page des scores.
Renvoie une erreur si aucun score n'a été demandé (max_results = 0) et limite le nombre à 25 s'il y en a trop.
Collection
LeaderboardCollection Collection() const
Renvoie la collection à laquelle appartient le classement.
Les valeurs possibles sont PUBLIC et SOCIAL.
CurrentPlayerScore
const Score & CurrentPlayerScore() const
Renvoie le score du joueur actuellement connecté.
LeaderboardId
const std::string & LeaderboardId() const
Renvoie la chaîne unique générée au préalable par la Google Play Developer Console.
Utilisez-le pour faire référence à un classement dans votre client de jeu. Elle ne peut être appelée que lorsque Leaderboard::Valid() renvoie la valeur "true".
ScoreSummary
ScoreSummary()
ScoreSummary
ScoreSummary(
std::shared_ptr< const ScoreSummaryImpl > impl
)
Construit un ScoreSummary
à partir d'un shared_ptr
vers un ScoreSummaryImpl
.
Destiné à un usage interne par l'API.
TimeSpan
LeaderboardTimeSpan TimeSpan() const
Renvoie la période du classement.
Les valeurs possibles sont DAILY, WEEKLY ou ALL_TIME.
Valide
bool Valid() const
Renvoie "true" si cet ScoreSummary
est renseigné avec des données.
Doit renvoyer "true" pour que les fonctions getter de l'objet ScoreSummary
(LeaderboardId
, TimeSpan
, etc.) soient utilisables.
~ScoreSummary
~ScoreSummary()
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[null,null,["Dernière mise à jour le 2025/07/27 (UTC)."],[],[],null,["# gpg::ScoreSummary Class Reference\n\ngpg::ScoreSummary\n=================\n\n`#include \u003cscore_summary.h\u003e`\n\nA single data structure which allows you to access a summary of score information.\n\nSummary\n-------\n\n| ### Constructors and Destructors ||\n|---|---|\n| [ScoreSummary](#classgpg_1_1_score_summary_1a899e0890b070d7260e35bb41db2a0518)`()` ||\n| [ScoreSummary](#classgpg_1_1_score_summary_1af4177fc02864bf1673621c724c4ff108)`(std::shared_ptr\u003c const ScoreSummaryImpl \u003e impl)` Constructs a [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) from a `shared_ptr` to a `ScoreSummaryImpl`. ||\n| [ScoreSummary](#classgpg_1_1_score_summary_1a838ce1b5e4d41a37a8742e6723be110c)`(const `[ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary)` & copy_from)` Creates a copy of an existing [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary). ||\n| [ScoreSummary](#classgpg_1_1_score_summary_1a3ba666ecd86f5086913aeb3f7935f370)`(`[ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary)` && move_from)` Moves an existing [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary). ||\n| [~ScoreSummary](#classgpg_1_1_score_summary_1aaf8c94d525e7c8ee047cf15bf390bd2a)`()` ||\n\n| ### Public functions ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ApproximateNumberOfScores](#classgpg_1_1_score_summary_1a424212fa25f0b5f911fc4bdb9b43bf8b)`() const ` | `uint64_t` Returns the approximate number of scores on the score page. |\n| [Collection](#classgpg_1_1_score_summary_1a3e9182df695dce4c5c9f8f56e3c82e30)`() const ` | [LeaderboardCollection](/games/services/cpp/api/namespace/gpg#namespacegpg_1a747eafdfd2bd9c613e2425d3aae5d960) Returns the collection to which the leaderboard belongs. |\n| [CurrentPlayerScore](#classgpg_1_1_score_summary_1af9940fb6712154c084342177b03c8d6c)`() const ` | `const `[Score](/games/services/cpp/api/class/gpg/score#classgpg_1_1_score)` &` Returns the score for the currently signed-in player. |\n| [LeaderboardId](#classgpg_1_1_score_summary_1ad19915b7a26185f7e2a306a6f6ec6d2a)`() const ` | `const std::string &` Returns the unique string that the Google Play Developer Console generated beforehand. |\n| [TimeSpan](#classgpg_1_1_score_summary_1ad62dca768cc9cb68ff7de6a1a81e18e8)`() const ` | [LeaderboardTimeSpan](/games/services/cpp/api/namespace/gpg#namespacegpg_1a8e678dc5182b81fa91bde5ff2517bfa9) Returns the leaderboard timespan. |\n| [Valid](#classgpg_1_1_score_summary_1a2d016d52c79cd3ce5e767ff19b0ccb7d)`() const ` | `bool` Returns true if this [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) is populated with data. |\n| [operator=](#classgpg_1_1_score_summary_1a1d5d63c85e0681d24e77db6275f2ed66)`(const `[ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary)` & copy_from)` | [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary)` &` Assigns this [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) by copying from another one. |\n| [operator=](#classgpg_1_1_score_summary_1a174ffcc85e8fc59677aec0a2073c5650)`(`[ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary)` && move_from)` | [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary)` &` Assigns this [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) by moving another one into it. |\n\nPublic functions\n----------------\n\n### ApproximateNumberOfScores\n\n```c++\nuint64_t ApproximateNumberOfScores() const \n``` \nReturns the approximate number of scores on the score page.\n\nReturns an error if no scores have been requested (max_results = 0), and clamps the number at 25 if there are an excessive number of them. \n\n### Collection\n\n```c++\nLeaderboardCollection Collection() const \n``` \nReturns the collection to which the leaderboard belongs.\n\nPossible values are PUBLIC and SOCIAL. \n\n### CurrentPlayerScore\n\n```c++\nconst Score & CurrentPlayerScore() const \n``` \nReturns the score for the currently signed-in player. \n\n### LeaderboardId\n\n```c++\nconst std::string & LeaderboardId() const \n``` \nReturns the unique string that the Google Play Developer Console generated beforehand.\n\nUse it to refer to a leaderboard in your game client. It can only be called when [Leaderboard::Valid()](/games/services/cpp/api/class/gpg/leaderboard#classgpg_1_1_leaderboard_1a510984968ca31ed44aafb18dec22a159) returns true. \n\n### ScoreSummary\n\n```c++\n ScoreSummary()\n``` \n\n### ScoreSummary\n\n```c++\n ScoreSummary(\n std::shared_ptr\u003c const ScoreSummaryImpl \u003e impl\n)\n``` \nConstructs a [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) from a `shared_ptr` to a `ScoreSummaryImpl`.\n\nIntended for internal use by the API. \n\n### ScoreSummary\n\n```c++\n ScoreSummary(\n const ScoreSummary & copy_from\n)\n``` \nCreates a copy of an existing [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary). \n\n### ScoreSummary\n\n```c++\n ScoreSummary(\n ScoreSummary && move_from\n)\n``` \nMoves an existing [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary). \n\n### TimeSpan\n\n```c++\nLeaderboardTimeSpan TimeSpan() const \n``` \nReturns the leaderboard timespan.\n\nPossible values are DAILY, WEEKLY, or ALL_TIME. \n\n### Valid\n\n```c++\nbool Valid() const \n``` \nReturns true if this [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) is populated with data.\n\nMust return true for the getter functions on the [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) object (`LeaderboardId`, `TimeSpan`, etc...) to be usable. \n\n### operator=\n\n```c++\nScoreSummary & operator=(\n const ScoreSummary & copy_from\n)\n``` \nAssigns this [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) by copying from another one. \n\n### operator=\n\n```c++\nScoreSummary & operator=(\n ScoreSummary && move_from\n)\n``` \nAssigns this [ScoreSummary](/games/services/cpp/api/class/gpg/score-summary#classgpg_1_1_score_summary) by moving another one into it. \n\n### \\~ScoreSummary\n\n```c++\n ~ScoreSummary()\n```"]]