stmm-games-doc  0.32.0
Public Member Functions | List of all members
stmg::AppPreferences::PrefPlayer Class Referenceabstract
Inheritance diagram for stmg::AppPreferences::PrefPlayer:
Inheritance graph
[legend]

Public Member Functions

virtual ~PrefPlayer () noexcept=default
 
virtual const std::string & getName () const noexcept=0
 The player's name. More...
 
virtual bool isAI () const noexcept=0
 Whether the player is AI. More...
 
virtual Variant getOptionValue (const std::string &sName) const noexcept=0
 Returns value of a player specific option. More...
 
virtual const shared_ptr< PrefTeamgetTeam () const noexcept=0
 The team the player belongs to as a mate. More...
 
virtual int32_t getMate () const noexcept=0
 The mate number within the team. More...
 
virtual int32_t get () const noexcept=0
 The player number within the game. More...
 
virtual std::vector< shared_ptr< stmi::Capability > > getCapabilities () const noexcept=0
 The capabilities assigned to the player. More...
 

Constructor & Destructor Documentation

◆ ~PrefPlayer()

virtual stmg::AppPreferences::PrefPlayer::~PrefPlayer ( )
virtualdefaultnoexcept

Member Function Documentation

◆ get()

virtual int32_t stmg::AppPreferences::PrefPlayer::get ( ) const
pure virtualnoexcept

The player number within the game.

Returns
The player number. Is >= 0 and < AppPreferences::getTotPlayers().

Implemented in stmg::StdPreferences::Player.

◆ getCapabilities()

virtual std::vector< shared_ptr<stmi::Capability> > stmg::AppPreferences::PrefPlayer::getCapabilities ( ) const
pure virtualnoexcept

The capabilities assigned to the player.

Returns
The capabilities. The pointers (if any) are not null.

Implemented in stmg::StdPreferences::Player.

◆ getMate()

virtual int32_t stmg::AppPreferences::PrefPlayer::getMate ( ) const
pure virtualnoexcept

The mate number within the team.

Note: *this == *(getTeam()->getMate(this->getMate()))

Returns
The mate number. Is >= 0 and < getTeam()->getTotMates().

Implemented in stmg::StdPreferences::Player.

◆ getName()

virtual const std::string& stmg::AppPreferences::PrefPlayer::getName ( ) const
pure virtualnoexcept

The player's name.

The name is unique among all players.

Returns
The name. Is not empty.

Implemented in stmg::StdPreferences::Player.

◆ getOptionValue()

virtual Variant stmg::AppPreferences::PrefPlayer::getOptionValue ( const std::string &  sName) const
pure virtualnoexcept

Returns value of a player specific option.

Parameters
sNameThe option name.
Returns
The value. Null if option name not defined.

Implemented in stmg::StdPreferences::Player.

◆ getTeam()

virtual const shared_ptr<PrefTeam> stmg::AppPreferences::PrefPlayer::getTeam ( ) const
pure virtualnoexcept

The team the player belongs to as a mate.

Returns
The team. Is not null.

Implemented in stmg::StdPreferences::Player.

◆ isAI()

virtual bool stmg::AppPreferences::PrefPlayer::isAI ( ) const
pure virtualnoexcept

Whether the player is AI.

This is a shortcut for the AI option.

See also
StdConfig::getAIOptionName
Returns
Whether AI.

Implemented in stmg::StdPreferences::Player.