stmm-games-doc  0.32.0
Public Member Functions | Public Attributes | List of all members
stmg::HighscoresDefinition::Discriminator Struct Reference

Separates highscores according to preference values. More...

Public Member Functions

bool operator== (const Discriminator &oHS) const noexcept
 

Public Attributes

DISCRIMINATOR_TYPE m_eType = DISCRIMINATOR_TYPE_OPTION
 The type of the discriminator. More...
 
std::string m_sOptionName = ""
 Name of option. More...
 
OwnerType m_eOptionOwnerType = OwnerType::GAME
 Whether the option is of game, team or player. More...
 

Detailed Description

Separates highscores according to preference values.

In the DISCRIMINATOR_TYPE_OPTION case, with owner type OwnerType::GAME, for a team to get in the highscores selected by this discriminator's HighscoresDefinition, its game has to have a master or enabled slave option with the given name. If the owner type is OwnerType::TEAM there has to be one and only one team with master or enabled slave option with the given name. If the owner type is OwnerType::PLAYER there has to be one and only one player in the game with master or enabled slave option with the given name.

Example of discriminator: a game enum option called "Difficulty" which has values "Easy", "Medium", "Hard". If it's the only discriminator passed to a HighscoresDefinition instance a Highscore will be created for all three values.

Member Function Documentation

◆ operator==()

bool stmg::HighscoresDefinition::Discriminator::operator== ( const Discriminator oHS) const
noexcept

Member Data Documentation

◆ m_eOptionOwnerType

OwnerType stmg::HighscoresDefinition::Discriminator::m_eOptionOwnerType = OwnerType::GAME

Whether the option is of game, team or player.

Default: OwnerType::GAME. Only set if m_eType is DISCRIMINATOR_TYPE_OPTION.

◆ m_eType

DISCRIMINATOR_TYPE stmg::HighscoresDefinition::Discriminator::m_eType = DISCRIMINATOR_TYPE_OPTION

The type of the discriminator.

Default: DISCRIMINATOR_TYPE_OPTION

◆ m_sOptionName

std::string stmg::HighscoresDefinition::Discriminator::m_sOptionName = ""

Name of option.

Default: empty string. Only set if m_eType is DISCRIMINATOR_TYPE_OPTION.