|
stmm-games-doc
0.32.0
|
The game constraints. More...

Public Member Functions | |
| void | initFromAppConstraints (const AppConstraints &oAppConstraints) noexcept |
| Initialize this instance values so that it is compatible with the given app constraints. More... | |
| bool | isValid () const noexcept |
| Whether the instance is valid (consistent). More... | |
| int32_t | getMinTeams () const noexcept |
| The minimum number of teams that can play. More... | |
| int32_t | getMaxTeams () const noexcept |
| The maximum number of teams that can play. More... | |
| int32_t | getMinPlayers () const noexcept |
| The minimum number of players that can play. More... | |
| int32_t | getMaxPlayers () const noexcept |
| The maximum number of players that can play. More... | |
| std::pair< bool, std::string > | isSelectedBy (const AppPreferences &oAppPreferences) const noexcept |
| Whether this constraints are compatible with preferences. More... | |
| std::pair< bool, std::string > | isCompatibleWith (const AppConstraints &oAppConstraints) const noexcept |
| Whether the game constraints are compatible with application constraints. More... | |
| bool | isAllTeamsInOneLevel () const noexcept |
| Whether this game's constraints allow more teams to play in the same level. More... | |
Public Member Functions inherited from stmg::AppConstraints | |
| bool | isValid () const noexcept |
| int32_t | getMaxTeams () const noexcept |
| The real max number of teams. More... | |
| int32_t | getMaxTeammates () const noexcept |
| The real max number of teammates. More... | |
| int32_t | getMaxPlayers () const noexcept |
| The real max number of players. More... | |
| bool | allowsAI () const noexcept |
| Whether AI players are allowed. More... | |
Public Attributes | |
| int32_t | m_nLevelsMin = 1 |
| Must be positive. More... | |
| int32_t | m_nLevelsMax = 1 |
| Cannot be smaller than m_nLevelsMin. More... | |
| int32_t | m_nTeamsPerLevelMin = 1 |
| Must be positive. More... | |
| int32_t | m_nTeamsPerLevelMax = 4 |
| Cannot be smaller than m_nTeamsPerLevelMin. More... | |
| int32_t | m_nMatesPerTeamMin = 1 |
| Must be positive. More... | |
| int32_t | m_nPlayersMin = 1 |
| Must be positive. More... | |
| int32_t | m_nAITeamsMin = 0 |
| Cannot be negative. More... | |
| int32_t | m_nAITeamsMax = 0 |
| Cannot be smaller than m_nAITeamsMin. More... | |
| shared_ptr< PrefSelector > | m_refPrefSelector |
| Additional constraints. More... | |
Public Attributes inherited from stmg::AppConstraints | |
| int32_t | m_nTeamsMin = 1 |
| Must be positive. More... | |
| int32_t | m_nTeamsMax = 4 |
| Default is 4. More... | |
| int32_t | m_nMatesPerTeamMax = 3 |
| Must be positive. More... | |
| int32_t | m_nPlayersMax = 12 |
| Must be positive. More... | |
| int32_t | m_nAIMatesPerTeamMax = 1 |
| Cannot be negative. More... | |
| bool | m_bAllowMixedAIHumanTeam = false |
| Default is false. More... | |
The game constraints.
This class can be used to define the conditions for which a game can be played. This allows game loaders to choose the games that are compatible with the current preferences. For example a game might work only for exactly 2 non AI teams in one level, so a single player (chosen in the preferences) should be prevented from playing the game.
GameConstraints is valid only if either all teams play in one level or each team plays in a separate level. Therefore defining a game with constraints (m_nLevelsMax > 1) and (m_nTeamsPerLevelMax > 1) is invalid.
|
inlinenoexcept |
The maximum number of players that can play.
This can be more restrictive than just AppConstraints::getMaxPlayers().
|
inlinenoexcept |
The maximum number of teams that can play.
This can be more restrictive than just AppConstraints::getMaxTeams().
|
inlinenoexcept |
The minimum number of players that can play.
This can be more restrictive than just m_nPlayersMin.
|
inlinenoexcept |
The minimum number of teams that can play.
This can be more restrictive than just m_nTeamsMin.
|
noexcept |
Initialize this instance values so that it is compatible with the given app constraints.
The app constraints must be valid.
| oAppConstraints | The app constraints. |
|
inlinenoexcept |
Whether this game's constraints allow more teams to play in the same level.
If the maximum number of levels and of teams per level is both one, this function returns true.
|
noexcept |
Whether the game constraints are compatible with application constraints.
| oAppConstraints | The app constraints. |
|
noexcept |
Whether this constraints are compatible with preferences.
| oAppPreferences | The preferences. |
|
noexcept |
Whether the instance is valid (consistent).
| int32_t stmg::GameConstraints::m_nAITeamsMax = 0 |
Cannot be smaller than m_nAITeamsMin.
Default is 0.
| int32_t stmg::GameConstraints::m_nAITeamsMin = 0 |
Cannot be negative.
Default is 0.
| int32_t stmg::GameConstraints::m_nLevelsMax = 1 |
Cannot be smaller than m_nLevelsMin.
Default is 1.
| int32_t stmg::GameConstraints::m_nLevelsMin = 1 |
Must be positive.
Default is 1.
| int32_t stmg::GameConstraints::m_nMatesPerTeamMin = 1 |
Must be positive.
Default is 1.
| int32_t stmg::GameConstraints::m_nPlayersMin = 1 |
Must be positive.
Default is 1.
| int32_t stmg::GameConstraints::m_nTeamsPerLevelMax = 4 |
Cannot be smaller than m_nTeamsPerLevelMin.
Default is 4.
| int32_t stmg::GameConstraints::m_nTeamsPerLevelMin = 1 |
Must be positive.
Default is 1.
| shared_ptr<PrefSelector> stmg::GameConstraints::m_refPrefSelector |
Additional constraints.
Can be null.
1.8.13