stmm-games-doc  0.32.0
Public Member Functions | Public Attributes | List of all members
stmg::StdConfig::CapabilityAssignment Class Referencefinal

Tells how device capabilities can be assigned (or not) to players. More...

Public Member Functions

bool isValid () const noexcept
 Tells whether the data in this structure instance makes sense. More...
 
bool canBeAssigned (const stmi::Capability::Class &oClass) const noexcept
 Tells whether a certain capability class can be assigned to players. More...
 

Public Attributes

bool m_bAllCapabilityClasses = true
 Whether all non device manager capability class instances can be assigned to a player. More...
 
std::vector< stmi::Capability::Classm_aCapabilityClasses
 The capability classes whose instances can be assigned to a player. More...
 
int32_t m_nMaxCapabilitiesExplicitlyAssignedToPlayer = 0
 The maximum number of capabilities that can be explicitly assigned to a player. More...
 
bool m_bMoreCapabilitiesPerClassAssignedToPlayer = false
 Whether more than one instance per capability class can be assigned to a player. More...
 
bool m_bCapabilitiesAutoAssignedToActivePlayer = false
 When only one human player is active, tells whether capabilities are automatically assigned to it. More...
 

Detailed Description

Tells how device capabilities can be assigned (or not) to players.

The default instance disables assignment of capabilities (explicitly and automatically) to players. That is the events that they generate are not sent to any player unless they define a key action.

Member Function Documentation

◆ canBeAssigned()

bool stmg::StdConfig::CapabilityAssignment::canBeAssigned ( const stmi::Capability::Class oClass) const
inlinenoexcept

Tells whether a certain capability class can be assigned to players.

Note that The stmi::PlaybackCapability is not included in this check.

Parameters
oClassThe capability class.
Returns
Whether devices providing the capability can be assigned to players.

◆ isValid()

bool stmg::StdConfig::CapabilityAssignment::isValid ( ) const
inlinenoexcept

Tells whether the data in this structure instance makes sense.

Returns
Whether it is valid.

Member Data Documentation

◆ m_aCapabilityClasses

std::vector<stmi::Capability::Class> stmg::StdConfig::CapabilityAssignment::m_aCapabilityClasses

The capability classes whose instances can be assigned to a player.

If m_bAllCapabilityClasses is true this field is ignored.

Note that the stmi::PlaybackCapability can always be assigned to a player if Init::m_bSoundPerPlayerAllowed is true so it cannot be an element of this vector. The default is empty.

◆ m_bAllCapabilityClasses

bool stmg::StdConfig::CapabilityAssignment::m_bAllCapabilityClasses = true

Whether all non device manager capability class instances can be assigned to a player.

Default is true.

◆ m_bCapabilitiesAutoAssignedToActivePlayer

bool stmg::StdConfig::CapabilityAssignment::m_bCapabilitiesAutoAssignedToActivePlayer = false

When only one human player is active, tells whether capabilities are automatically assigned to it.

If it's the case events generated by the capabilities according to m_bAllCapabilityClasses, m_aCapabilityClasses and m_bMoreCapabilitiesPerClassAssignedToPlayer are sent to that player. The default is false.

◆ m_bMoreCapabilitiesPerClassAssignedToPlayer

bool stmg::StdConfig::CapabilityAssignment::m_bMoreCapabilitiesPerClassAssignedToPlayer = false

Whether more than one instance per capability class can be assigned to a player.

The default is false. This only makes sense in very unlikely games where for example two keyboards or joysticks per player are needed.

Note: at most one sound playback capability can be assigned to a player regardless of the value of this field.

◆ m_nMaxCapabilitiesExplicitlyAssignedToPlayer

int32_t stmg::StdConfig::CapabilityAssignment::m_nMaxCapabilitiesExplicitlyAssignedToPlayer = 0

The maximum number of capabilities that can be explicitly assigned to a player.

The default is 0, which means you cannot explicitly assign capabilities to a player, only automatically to a single active human player.

Beware! This number doesn't include the playback capability that can be assigned to a player if Init::m_bSoundPerPlayerAllowed is true.

See also
m_bCapabilitiesAutoAssignedToActivePlayer.