|
stmm-games-doc
0.32.0
|

Classes | |
| class | Player |
| class | Team |
Public Member Functions | |
| StdPreferences (const shared_ptr< StdConfig > &refStdConfig) noexcept | |
| Constructor. More... | |
| StdPreferences (const StdPreferences &oSource) noexcept | |
| Copy constructor. More... | |
| StdPreferences & | operator= (const StdPreferences &oSource) noexcept |
| Copy assignment. More... | |
| bool | isInEditMode () const noexcept |
| Get edit mode. More... | |
| void | setEditMode (bool bInEditMode) noexcept |
| Set edit mode. More... | |
| int32_t | getMaxPlayerNameLength () const noexcept |
| The player name maximum length in unicode characters. More... | |
| int32_t | getMaxTeamNameLength () const noexcept |
| The team name maximum length in unicode characters. More... | |
| bool | playerMoveUp (const std::string &sPlayerName) noexcept |
| Move a player up in the hierarchy. More... | |
| bool | playerMoveDown (const std::string &sPlayerName) noexcept |
| Move a player down in the hierarchy. More... | |
| bool | playerTeamUp (const std::string &sPlayerName) noexcept |
| Move a player to the preceding team in the hierarchy. More... | |
| bool | playerTeamDown (const std::string &sPlayerName) noexcept |
| Move a player to the following team in the hierarchy. More... | |
| const shared_ptr< Player > & | getPlayerFull (int32_t nPlayer) const noexcept |
| Get the player. More... | |
| const shared_ptr< Player > & | getPlayerFull (const std::string &sPlayerName) const noexcept |
| Get the player. More... | |
| const shared_ptr< Team > & | getTeamFull (int32_t nTeam) const noexcept |
| Get the team. More... | |
| const shared_ptr< Team > & | getTeamFull (const std::string &sTeamName) const noexcept |
| Get the team. More... | |
| bool | setTotTeams (int32_t nTeams) noexcept |
| Set the total number of teams. More... | |
| bool | setTotPlayers (int32_t nPlayers) noexcept |
| Set the the total number of players. More... | |
| int32_t | getTotTeams () const noexcept override |
| The total number of teams. More... | |
| const shared_ptr< PrefTeam > | getTeam (int32_t nTeam) const noexcept override |
| Get team by number. More... | |
| const shared_ptr< PrefTeam > | getTeam (const std::string &sTeamName) const noexcept override |
| Get team by name. More... | |
| std::vector< std::string > | getTeamNames () const noexcept override |
| The number of teams. More... | |
| int32_t | getTotPlayers () const noexcept override |
| The number of players. More... | |
| const shared_ptr< PrefPlayer > | getPlayer (int32_t nPlayer) const noexcept override |
| Get player by number. More... | |
| const shared_ptr< PrefPlayer > | getPlayer (const std::string &sPlayerName) const noexcept override |
| Get player by name. More... | |
| void | getTeammate (int32_t nPlayer, int32_t &nTeam, int32_t &nMate) const noexcept override |
| Get team an mate number from player number. More... | |
| int32_t | getTotHumanPlayers () const noexcept override |
| The number of human players. More... | |
| int32_t | getTotAIPlayers () const noexcept override |
| The number of AI players. More... | |
| int32_t | getTotHumanTeams () const noexcept override |
| The number of human teams. More... | |
| int32_t | getTotAITeams () const noexcept override |
| The number of AI teams. More... | |
| Variant | getOptionValue (const std::string &sOptionName) const noexcept override |
| Returns value of a game option. More... | |
| bool | setOptionValue (const std::string &sOptionName, const Variant &oValue) noexcept |
| Set the value of a game's option. More... | |
| bool | getPlayerKeyActionFromCapabilityKey (int32_t nCapabilityId, stmi::HARDWARE_KEY eKey, shared_ptr< PrefPlayer > &refPlayer, int32_t &nKeyActionId) const noexcept override |
| Given a key generated by a capability, return the player's key action. More... | |
| bool | getPlayerKeyActionFromCapabilityKey (int32_t nCapabilityId, stmi::HARDWARE_KEY eKey, int32_t &nTeam, int32_t &nMate, int32_t &nKeyActionId) const noexcept override |
| Given a key generated by a capability, return the player's key action. More... | |
| bool | getCapabilityPlayer (int32_t nCapabilityId, shared_ptr< PrefPlayer > &refPlayer) const noexcept override |
| The player to which a capability is assigned. More... | |
| bool | getCapabilityPlayer (int32_t nCapabilityId, int32_t &nTeam, int32_t &nMate) const noexcept override |
| The player to which a capability is assigned. More... | |
| bool | getCapabilityPlayerFull (int32_t nCapabilityId, shared_ptr< Player > &refPlayer) const noexcept |
| The player to which a capability is assigned. More... | |
| std::vector< stmi::Capability::Class > | getCapabilityClasses () const noexcept |
| Get all the capability classes handled by the preferences. More... | |
| int32_t | getCapabilityClassDeviceIdx (stmi::Capability const *p0Capability) const noexcept |
| Get the capability class device index of a capability. More... | |
| shared_ptr< stmi::Capability > | getCapabilityFromClassDeviceIdx (const stmi::Capability::Class &oCapaClass, int32_t nDeviceIdx) const noexcept |
| Get the capability from the capability class device index. More... | |
| const shared_ptr< AppConfig > & | getAppConfig () const noexcept override |
| The application config. More... | |
| const shared_ptr< StdConfig > & | getStdConfig () noexcept |
Public Member Functions inherited from stmg::AppPreferences | |
| virtual | ~AppPreferences () noexcept=default |
|
explicitnoexcept |
Constructor.
The initial number of teams is defined by AppConstraints::m_nTeamsMin which is obtained with refStdConfig->getAppConstraints(). Initially each team has one human player.
The instance is created in edit mode.
| refStdConfig | The configuration. Cannot be null. |
|
noexcept |
Copy constructor.
| oSource | The source. |
|
inlineoverridevirtualnoexcept |
|
noexcept |
Get the capability class device index of a capability.
The device index is not the device id. The device index is an internal representation of the preferences. All the capabilities of the same capability class are assigned indexes 0, 1, and so on.
This can be used to serialize the preferences.
| p0Capability | The capability. Cannot be null. |
|
noexcept |
Get all the capability classes handled by the preferences.
These are the classes of devices that can be assigned to key actions and players.
|
noexcept |
Get the capability from the capability class device index.
It is the inverse of getCapabilityClassDeviceIdx().
This can be used to serialize the preferences.
| oCapaClass | The capability class. Must be in getCapabilityClasses(). |
| nDeviceIdx | The device index. Must be >= 0. |
|
overridevirtualnoexcept |
The player to which a capability is assigned.
| nCapabilityId | The id of the capability. |
| refPlayer | The player the capability is assigned to or unchanged. |
Implements stmg::AppPreferences.
|
overridevirtualnoexcept |
The player to which a capability is assigned.
| nCapabilityId | The id of the capability. |
| nTeam | The team of the player the capability is assigned to or unchanged. |
| nMate | The mate of the player the capability is assigned to or unchanged. |
Implements stmg::AppPreferences.
|
noexcept |
The player to which a capability is assigned.
| nCapabilityId | The id of the capability. |
| refPlayer | (output) The player the capability is assigned to or unchanged. |
|
noexcept |
The player name maximum length in unicode characters.
|
noexcept |
The team name maximum length in unicode characters.
|
overridevirtualnoexcept |
Returns value of a game option.
| sName | The option name. |
Implements stmg::AppPreferences.
|
overridevirtualnoexcept |
Get player by number.
| nPlayer | The player number. Must be >=0 and < AppPreferences::getTotPlayers(). |
Implements stmg::AppPreferences.
|
overridevirtualnoexcept |
Get player by name.
Player names are unique.
| sPlayerName | The name of the player. Cannot be empty. |
Implements stmg::AppPreferences.
|
noexcept |
Get the player.
| nPlayer | The player number. Must be valid. |
|
noexcept |
Get the player.
| sPlayerName | The player name. Must exist. |
|
overridevirtualnoexcept |
Given a key generated by a capability, return the player's key action.
| nCapabilityId | The id of the capability. |
| eKey | The key. Cannot be stmi::HK_NULL. |
| refPlayer | The player associated with the key. Unchanged if not found. |
| nKeyActionId | The key action associated with the key. Unchanged if not found. |
Implements stmg::AppPreferences.
|
overridevirtualnoexcept |
Given a key generated by a capability, return the player's key action.
| nCapabilityId | The id of the capability. |
| eKey | The key. Cannot be stmi::HK_NULL. |
| nTeam | The player's team associated with the key, unchanged if not found. |
| nMate | The player's mate associated with the key, unchanged if not found. |
| nKeyActionId | The key action associated with the key. Unchanged if not found. |
Implements stmg::AppPreferences.
|
inlinenoexcept |
|
overridevirtualnoexcept |
Get team by number.
| nTeam | The team number. Must be >=0 and < AppPreferences::getTotTeams(). |
Implements stmg::AppPreferences.
|
overridevirtualnoexcept |
Get team by name.
Team names are unique.
| sTeamName | The name of the team. Cannot be empty. |
Implements stmg::AppPreferences.
|
noexcept |
Get the team.
| nTeam | The team number. Must be valid. |
|
noexcept |
Get the team.
| sTeamName | The team name. Must exist. |
|
overridevirtualnoexcept |
Get team an mate number from player number.
| nPlayer | The player number. Must be valid. |
| nTeam | (output) The team of the player. |
| nMate | (output) The mate number within the team of the player. |
Implements stmg::AppPreferences.
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
|
overridevirtualnoexcept |
The number of players.
Implements stmg::AppPreferences.
|
overridevirtualnoexcept |
The total number of teams.
Implements stmg::AppPreferences.
|
inlinenoexcept |
Get edit mode.
|
noexcept |
Copy assignment.
| oSource | The source. |
|
noexcept |
Move a player down in the hierarchy.
If the player is not the last mate of the team it is swapped with the following mate. If the player is the last mate of the team it is swapped with the first mate of the following team. The swap is only allowed if it doesn't violate some AI player constraint.
The last player of the last team cannot be moved down.
| sPlayerName | The player's name. Must exist. |
|
noexcept |
Move a player up in the hierarchy.
If the player is not the first mate of the team it is swapped with the preceding mate. If the player is the first mate of the team it is swapped with the last mate of the preceding team. The swap is only allowed if it doesn't violate some AI player constraint.
The first player of the first team cannot be moved up.
| sPlayerName | The player's name. Must exist. |
|
noexcept |
Move a player to the following team in the hierarchy.
If a player violates some AI constraints the function might fail.
A player of the last team cannot "team down".
| sPlayerName | The player's name. Must exist. |
|
noexcept |
Move a player to the preceding team in the hierarchy.
If a player violates some AI constraints the function might fail.
A player of the first team cannot "team up".
| sPlayerName | The player's name. Must exist. |
|
noexcept |
Set edit mode.
The instance can be either in edit or in running mode. In running mode players and teams cannot be added or removed, options cannot be changed. In running mode removed and then re-added devices are automatically assigned to a player.
| bInEditMode | The chosen mode. |
|
noexcept |
Set the value of a game's option.
| sOptionName | The name of the option (OwnerType::GAME). Must exist and not be read-only. |
| oValue | The new value. |
|
noexcept |
Set the the total number of players.
If the constraints limited the addition or removal of players false is returned. The limiting factors might be the minimum number of teams, the maximum number of AI mates, etc.
Unless it's full, new players are added to the last team, otherwise to the preceding team and so on.
| nPlayers | The number of players. Must be >= 0. |
|
noexcept |
Set the total number of teams.
If the constraints limited the addition or removal of teams false is returned. The limiting factor might be the minimum or maximum number of teams.
| nTeams | The number of teams. Must be >= 0. |
1.8.13