|
stmm-games-doc
0.32.0
|
Class the holds highscores. More...
Classes | |
| struct | Score |
Public Member Functions | |
| Highscore (const shared_ptr< HighscoresDefinition > &refHighscoresDefinition, const std::string &sCodeString, const std::string &sTitleString) noexcept | |
| Constructor. More... | |
| Highscore (const shared_ptr< HighscoresDefinition > &refHighscoresDefinition, const std::string &sCodeString, const std::string &sTitleString, const std::vector< Score > &aScores) noexcept | |
| Constructor. More... | |
| const shared_ptr< HighscoresDefinition > & | getHighscoresDefinition () const noexcept |
| The HighscoresDefinition this Highscore is based on. More... | |
| const std::string & | getCodeString () const noexcept |
| The code string as passed to the constructor. More... | |
| const std::string & | getTitleString () const noexcept |
| The title string as passed to the constructor. More... | |
| int32_t | getTotScores () const noexcept |
| The total number of scores. More... | |
| const Score & | getScore (int32_t nPosition) const noexcept |
| Get the score at a given position. More... | |
| void | setScoreTeamName (int32_t nPosition, const std::string &sTeam) noexcept |
| Override the team name of a score. More... | |
| std::vector< int32_t > | includeGame (const Game &oGame) noexcept |
| Insert all the teams that ended the game in the highscores (if they are eligible). More... | |
| std::vector< int32_t > | includeGame (const Game &oGame, bool bCheckElegibility) noexcept |
| Insert the teams in a game in the highscores. More... | |
| int32_t | positionIfIncluded (const Game &oGame, int32_t nTeam) const noexcept |
| Get the position of a team if it were included in the highscores. More... | |
Protected Member Functions | |
| void | reInit (const shared_ptr< HighscoresDefinition > &refHighscoresDefinition, const std::string &sCodeString, const std::string &sTitleString) noexcept |
| See constructor. More... | |
| void | reInit (const shared_ptr< HighscoresDefinition > &refHighscoresDefinition, const std::string &sCodeString, const std::string &sTitleString, const std::vector< Score > &aScores) noexcept |
| See constructor. More... | |
Class the holds highscores.
All position are 0 based. That is the best score has position 0, the second best has position 1 and so on.
|
noexcept |
Constructor.
| refHighscoresDefinition | The highscore definition. Cannot be null. |
| sCodeString | The code string. Must have been generated by refHighscoresDefinition or be empty. |
| sTitleString | The title string. Should have been generated by refHighscoresDefinition or be empty. |
|
noexcept |
Constructor.
| refHighscoresDefinition | The highscore definition. Cannot be null. |
| sCodeString | The code string. Must have been generated by refHighscoresDefinition. |
| sTitleString | The title string. Should have been generated by refHighscoresDefinition. |
| aScores | The initial scores. The team name of the scores must be defined. |
|
inlinenoexcept |
The code string as passed to the constructor.
|
inlinenoexcept |
The HighscoresDefinition this Highscore is based on.
|
inlinenoexcept |
Get the score at a given position.
| nPosition | The position. 0 is the top highscore. |
|
inlinenoexcept |
The title string as passed to the constructor.
|
inlinenoexcept |
The total number of scores.
|
noexcept |
Insert all the teams that ended the game in the highscores (if they are eligible).
Before possibly inserting the teams it sets the m_nTeam value of the existing teams to -1 so that after this call that field is only set for the teams that just played.
| oGame | The game. |
|
noexcept |
Insert the teams in a game in the highscores.
Before possibly inserting the teams it sets the m_nTeam value of the existing teams to -1 so that after this call that field is only set for the teams that just played.
The eligibility check also includes whether a team has finished the game. This means that if you call this function when the game isn't finished yet with parameter bCheckElegibility set to true the empty vector is returned.
| oGame | The game. |
| bCheckElegibility | Whether to check for eligibility. |
|
noexcept |
Get the position of a team if it were included in the highscores.
Constraints and eligibilities are not evaluated.
| oGame | The game. Might be running. |
| nTeam | The team. Must be valid. |
|
protectednoexcept |
See constructor.
|
protectednoexcept |
See constructor.
|
inlinenoexcept |
Override the team name of a score.
| nPosition | The score position. Must be valid. |
| sTeam | The new team name. Cannot be empty. |
1.8.13