Stay organized with collections
Save and categorize content based on your preferences.
gpg::ScoreSummary
#include <score_summary.h>
A single data structure which allows you to access a summary of score information.
Summary
Public functions
ApproximateNumberOfScores
uint64_t ApproximateNumberOfScores() const
Returns the approximate number of scores on the score page.
Returns 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.
Collection
LeaderboardCollection Collection() const
Returns the collection to which the leaderboard belongs.
Possible values are PUBLIC and SOCIAL.
CurrentPlayerScore
const Score & CurrentPlayerScore() const
Returns the score for the currently signed-in player.
LeaderboardId
const std::string & LeaderboardId() const
Returns the unique string that the Google Play Developer Console generated beforehand.
Use it to refer to a leaderboard in your game client. It can only be called when Leaderboard::Valid() returns true.
ScoreSummary
ScoreSummary()
ScoreSummary
ScoreSummary(
std::shared_ptr< const ScoreSummaryImpl > impl
)
Constructs a ScoreSummary
from a shared_ptr
to a ScoreSummaryImpl
.
Intended for internal use by the API.
TimeSpan
LeaderboardTimeSpan TimeSpan() const
Returns the leaderboard timespan.
Possible values are DAILY, WEEKLY, or ALL_TIME.
Valid
bool Valid() const
Returns true if this ScoreSummary
is populated with data.
Must return true for the getter functions on the ScoreSummary
object (LeaderboardId
, TimeSpan
, etc...) to be usable.
~ScoreSummary
~ScoreSummary()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-10-28 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-28 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```"]]