使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
gpg::ScoreSummary
#include <score_summary.h>
一个数据结构,可让您访问得分信息摘要。
摘要
公共函数
ApproximateNumberOfScores
uint64_t ApproximateNumberOfScores() const
返回评分页面上的大致评分数量。
如果未请求任何得分(max_results = 0),则返回错误;如果得分过多,则将其限制为 25 个。
CurrentPlayerScore
const Score & CurrentPlayerScore() const
LeaderboardId
const std::string & LeaderboardId() const
ScoreSummary
ScoreSummary()
ScoreSummary
ScoreSummary(
std::shared_ptr< const ScoreSummaryImpl > impl
)
将 shared_ptr
构建为 ScoreSummaryImpl
的 ScoreSummary
。
供 API 内部使用。
~ScoreSummary
~ScoreSummary()
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],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```"]]