|
stmm-games-doc
0.32.0
|

Classes | |
| class | CapabilityAssignment |
| Tells how device capabilities can be assigned (or not) to players. More... | |
| struct | Init |
| class | KeyAction |
| The key action class. More... | |
Public Member Functions | |
| StdConfig (StdConfig::Init &&oInit) noexcept | |
| Constructor. More... | |
| const std::string & | getAppName () const noexcept override |
| The name of the application. More... | |
| const std::string & | getAppVersion () const noexcept override |
| The version of the application. More... | |
| shared_ptr< stmi::DeviceManager > | getDeviceManager () const noexcept override |
| Get the device manager. More... | |
| const AppConstraints & | getAppConstraints () const noexcept override |
| The application constraints. More... | |
| const CapabilityAssignment & | getCapabilityAssignment () const noexcept |
| How capabilities are assigned (or not) to players. More... | |
| int32_t | getTotKeyActions () const noexcept override |
| The total number of key actions. More... | |
| int32_t | getKeyActionId (const std::string &sKeyActionName) const noexcept override |
| Get to the key action id from its name. More... | |
| bool | isEventAssignedToActivePlayer () const noexcept override |
| Tells whether events should be assigned to the active player. More... | |
| bool | soundEnabled () const noexcept override |
| Whether the game plays sounds. More... | |
| bool | canPlayPerPlayerSounds () const noexcept override |
| Whether allows playback devices to be assigned to players. More... | |
| bool | isTestMode () const noexcept override |
| Whether in testing mode. More... | |
| int32_t | getMaxGamePlayedHistory () const noexcept |
| The maximum number of games in the recently played games history. More... | |
| shared_ptr< stmi::PlaybackCapability > | getDefaultPlayback () const noexcept |
| Get the default playback capability. More... | |
| const KeyAction & | getKeyAction (int32_t nKeyActionId) const noexcept |
| Get Key Action data. More... | |
| const NamedObjIndex< shared_ptr< Option > > & | getOptions (OwnerType eOwner) const noexcept override |
| Get the options for an owner type. More... | |
| const shared_ptr< Option > & | getOption (OwnerType eOwner, const std::string &sName) const noexcept override |
| Get an option by name. More... | |
| int32_t | getTotVisibleOptions () const noexcept |
| int32_t | getTotVisibleOptions (OwnerType eOwner) const noexcept |
Public Member Functions inherited from stmg::AppConfig | |
| virtual | ~AppConfig () noexcept=default |
Static Public Member Functions | |
| static const std::string & | getAIOptionName () noexcept |
| The AI option name. More... | |
| static const std::string & | getSoundEnabledOptionName () noexcept |
| The sound enabled option name. More... | |
| static const std::string & | getPerPlayerSoundOptionName () noexcept |
| The "per player sound" option name. More... | |
| static const std::string & | getSoundVolumeOptionName () noexcept |
| The sound volume option name. More... | |
| static shared_ptr< BoolOption > | createAIOption (OwnerType eOwnerType, const std::string &sAIOptionDesc) noexcept |
| Create an AI option to pass to the constructor StdConfig::StdConfig(). More... | |
| static shared_ptr< BoolOption > | createSoundEnabledOption (bool bSoundEnabled) noexcept |
| Create the SoundEnabled option to pass to the constructor of StdConfig. More... | |
| static shared_ptr< BoolOption > | createPerPlayerSoundOption (const std::string &sOptionDesc) noexcept |
| Create the PerPlayerSound option to pass to the constructor of StdConfig. More... | |
| static shared_ptr< IntOption > | createSoundVolumeOption (OwnerType eOwnerType, const std::string &sOptionDesc, const shared_ptr< BoolOption > &refPerPlayerSound, const shared_ptr< BoolOption > &refAIPlayer) noexcept |
| Create a SoundVolume option to pass to the constructor of StdConfig. More... | |
|
explicitnoexcept |
Constructor.
An option cannot be slave of an option that is not also in Init::m_aOptions.
An AI BoolOption is always defined for each type of owner and created automatically if not in Init::m_aOptions. If you need to create an AI option use StdConfig::createAIOption(). AI options should be passed with Init::m_aOptions only if AI players are allowed, that is if getAppConstraints().allowsAI() == true. If created automatically AI options are placed before all other options (passed in Init::m_aOptions).
Sound options are always defined and created automatically if not in Init::m_aOptions. If you need to create a sound option use StdConfig::createSoundEnabledOption(), StdConfig::createPerPlayerSoundOption(), StdConfig::createSoundVolumeOption().
Sound options should only be passed in Init::m_aOptions if Init::m_bSoundEnabled == true. The option created by StdConfig::createSoundEnabledOption() should only be passed if Init::m_bSoundPerPlayerAllowed == true. The option created by StdConfig::createSoundVolumeOption() for players should only be passed if Init::m_bSoundPerPlayerAllowed == true.
| oInit | The initialization structure. |
|
inlineoverridevirtualnoexcept |
Whether allows playback devices to be assigned to players.
If true the game allows playback devices such as head phones to be assigned to each player for personalized output. Ignored if playsSounds() returns false.
Implements stmg::AppConfig.
|
staticnoexcept |
Create an AI option to pass to the constructor StdConfig::StdConfig().
This function should only be used if getAppConstraints().allowsAI() == true.
If an AI option for a certain owner type is not passed to the constructor it is created automatically with some default description string. This function allows you to create the option and set the description string and possibly use it as a master option for another slave option (ex. 'AISmartness').
If the owner is game, the created option is readonly and invisible and the default value is true iff AI players are allowed.
If the owner is team, the option is readonly. It is visible iff AI players are allowed. The default value should be ignored since a team should be considered AI only if all its players are AI.
If the owner is player, the option is modifiable and visible iff AI players are allowed. The default value is false (human player).
| eOwnerType | The owner type. |
| sAIOptionDesc | The description of the option. |
|
staticnoexcept |
Create the PerPlayerSound option to pass to the constructor of StdConfig.
| sOptionDesc | The description of the option. |
|
staticnoexcept |
Create the SoundEnabled option to pass to the constructor of StdConfig.
The created option is owned by game and is read-only and invisible. Its default value is set to bSoundEnabled. It must be the same as Init::m_bSoundEnabled.
This function allows you to create the option to possibly use it as a master option for another slave option (ex. 'EnableCountdownSounds').
| bSoundEnabled | Whether sound is enabled or not. |
|
staticnoexcept |
Create a SoundVolume option to pass to the constructor of StdConfig.
| eOwnerType | The owner type. Must either OwnerTyoe::GAME or OwnerTyoe::PLAYER. |
| sOptionDesc | The description of the option. |
| refPerPlayerSound | The master PerPlayerSound option possibly created with createSoundEnabledOption(). Cannot be null |
| refAIPlayer | The master AI option if eOwnerType == OwnerTyoe::PLAYER and AI allowed, otherwise must be null. |
|
staticnoexcept |
The AI option name.
This name is the same for OwnerType::GAME, OwnerType::TEAM and OwnerType::PLAYER options.
The option, if passed to the constructor with m_aOptions, must be a BoolOption, not be a slave.
|
inlineoverridevirtualnoexcept |
|
inlineoverridevirtualnoexcept |
The name of the application.
Implements stmg::AppConfig.
|
inlineoverridevirtualnoexcept |
The version of the application.
Implements stmg::AppConfig.
|
inlinenoexcept |
How capabilities are assigned (or not) to players.
|
noexcept |
Get the default playback capability.
|
inlineoverridevirtualnoexcept |
Get the device manager.
The device manager is the source of the input events.
Implements stmg::AppConfig.
|
noexcept |
Get Key Action data.
| nKeyActionId | The key action id. Cannot be a negative number. |
|
overridevirtualnoexcept |
Get to the key action id from its name.
| sKeyActionName | The key action name. |
Implements stmg::AppConfig.
|
inlinenoexcept |
The maximum number of games in the recently played games history.
|
overridevirtualnoexcept |
Get an option by name.
| eOwner | The owner type. |
| sName | The name of the option. Cannot be empty. |
Implements stmg::AppConfig.
|
overridevirtualnoexcept |
Get the options for an owner type.
| eOwner | The owner type. |
Implements stmg::AppConfig.
|
staticnoexcept |
The "per player sound" option name.
|
staticnoexcept |
The sound enabled option name.
|
staticnoexcept |
The sound volume option name.
|
overridevirtualnoexcept |
The total number of key actions.
A valid key action id is a number from 0 to getTotKeyActions()-1.
Implements stmg::AppConfig.
|
noexcept |
|
noexcept |
|
inlineoverridevirtualnoexcept |
Tells whether events should be assigned to the active player.
If this function returns true, the game, when it receives an event from a device's capability that wasn't assigned to a player in the preferences, will try to assign it to the unique active human player. If more than one human player is active at the moment the event is received, it is dropped.
This is useful in turn based games where the two players use the same device (ex. the mouse). Be aware that it can cause inconsistencies. Example: if between the press and the release of a joystick button the active player is changed the release event is sent to a different player.
Implements stmg::AppConfig.
|
inlineoverridevirtualnoexcept |
Whether in testing mode.
This flag can be used to output additional information.
Implements stmg::AppConfig.
|
inlineoverridevirtualnoexcept |
Whether the game plays sounds.
If this function returns false sounds are not played and the view preferences should not show widgets to choose the volume.
Implements stmg::AppConfig.
1.8.13