|
stmm-games-doc
0.32.0
|

Public Member Functions | |
| Player () noexcept | |
| const std::string & | getName () const noexcept override |
| The player's name. More... | |
| bool | isAI () const noexcept override |
| Whether the player is AI. More... | |
| const shared_ptr< PrefTeam > | getTeam () const noexcept override |
| The team the player belongs to as a mate. More... | |
| Variant | getOptionValue (const std::string &sOptionName) const noexcept override |
| Returns value of a player specific option. More... | |
| int32_t | getMate () const noexcept override |
| The mate number within the team. More... | |
| int32_t | get () const noexcept override |
| The player number within the game. More... | |
| shared_ptr< Team > & | getTeamFull () noexcept |
| Get the player's team. More... | |
| bool | setName (const std::string &sNewName) noexcept |
| Set the player's name. More... | |
| std::pair< stmi::Capability *, stmi::HARDWARE_KEY > | getKeyValue (int32_t nKeyActionId) const noexcept |
| Get the capability and key assigned a key action. More... | |
| bool | setKeyValue (int32_t nKeyActionId, stmi::Capability *p0Capability, stmi::HARDWARE_KEY eKey) noexcept |
| Assign a capability key to a player's key action. More... | |
| bool | setAI (bool bIsAI) noexcept |
| Sets player to AI or human. More... | |
| bool | setOptionValue (const std::string &sOptionName, const Variant &oValue) noexcept |
| Set the value of a player's option. More... | |
| bool | assignCapability (const shared_ptr< stmi::Capability > &refCapability) noexcept |
| Assign capability to player. More... | |
| bool | unassignCapability (const shared_ptr< stmi::Capability > &refCapability) noexcept |
| Unassign capability from player. More... | |
| std::vector< shared_ptr< stmi::Capability > > | getCapabilities () const noexcept override |
| Get the capabilities assigned to the player. More... | |
| template<typename TCapa > | |
| bool | getCapability (shared_ptr< TCapa > &refCapa) const noexcept |
| Request a capability of a registered class assigned to this player. More... | |
| shared_ptr< stmi::Capability > | getCapability (const stmi::Capability::Class &oClass) const noexcept |
| Request a capability of a registered class assigned to this player. More... | |
Public Member Functions inherited from stmg::AppPreferences::PrefPlayer | |
| virtual | ~PrefPlayer () noexcept=default |
|
inlinenoexcept |
|
noexcept |
Assign capability to player.
If a capability is already assigned to another player it is first unassigned from the other player.
| refCapability | The capability. Cannot be null. |
|
inlineoverridevirtualnoexcept |
The player number within the game.
Implements stmg::AppPreferences::PrefPlayer.
|
overridevirtualnoexcept |
Get the capabilities assigned to the player.
Implements stmg::AppPreferences::PrefPlayer.
|
inlinenoexcept |
Request a capability of a registered class assigned to this player.
If more than one capability of class TCapa is assigned to this player, one is chosen.
| refCapa | [out] The registered Capability subclass or null if not assigned. |
|
noexcept |
Request a capability of a registered class assigned to this player.
If more than one capability of class oClass is assigned to this player one is chosen.
| oClass | The registered capability class. |
|
noexcept |
Get the capability and key assigned a key action.
The returned pair is {null, stmi::HK_NULL} if the key action wasn't defined or {null, eKey} if the capability was removed at runtime.
| nKeyActionId | The key action id. |
|
inlineoverridevirtualnoexcept |
The mate number within the team.
Note: *this == *(getTeam()->getMate(this->getMate()))
Implements stmg::AppPreferences::PrefPlayer.
|
inlineoverridevirtualnoexcept |
The player's name.
The name is unique among all players.
Implements stmg::AppPreferences::PrefPlayer.
|
overridevirtualnoexcept |
Returns value of a player specific option.
| sName | The option name. |
Implements stmg::AppPreferences::PrefPlayer.
|
inlineoverridevirtualnoexcept |
The team the player belongs to as a mate.
Implements stmg::AppPreferences::PrefPlayer.
|
inlinenoexcept |
Get the player's team.
|
inlineoverridevirtualnoexcept |
Whether the player is AI.
This is a shortcut for the AI option.
Implements stmg::AppPreferences::PrefPlayer.
|
noexcept |
Sets player to AI or human.
| bIsAI | Whether the player is AI. |
|
noexcept |
Assign a capability key to a player's key action.
If the new capability key is already assigned to another key action it is swapped.
| nKeyActionId | The key action id. |
| p0Capability | The capability. Cannot be null. |
| eKey | The key. Cannot be stmi::HK_NULL. |
|
noexcept |
Set the player's name.
If another existing player already has the name the operation fails and false is returned.
| sNewName | The new name. Cannot be empty. |
|
noexcept |
Set the value of a player's option.
| sOptionName | The name of the option. Must exist and not be read only. |
| oValue | The new value. |
|
noexcept |
Unassign capability from player.
| refCapability | The capability. Cannot be null. |
1.8.13