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

Public Member Functions

 AllPreferences (const shared_ptr< StdConfig > &refStdConfig) noexcept
 Constructor. More...
 
 AllPreferences (const AllPreferences &oSource) noexcept
 Copy constructor. More...
 
AllPreferencesoperator= (const AllPreferences &oSource) noexcept
 Copy assignment. More...
 
std::string getGameName () const noexcept
 Get the chosen game name. More...
 
void setGameName (const std::string &sGameName) noexcept
 Set game name. More...
 
std::string getThemeName () const noexcept
 Get the chosen theme name. More...
 
void setThemeName (const std::string &sThemeName) noexcept
 Set theme name. More...
 
void addGameToPlayedHistory (const std::string &sGameName) noexcept
 Add game to the played history. More...
 
const std::vector< std::string > & getPlayedGameHistory () const noexcept
 The current played games history. More...
 
- Public Member Functions inherited from stmg::StdPreferences
 StdPreferences (const shared_ptr< StdConfig > &refStdConfig) noexcept
 Constructor. More...
 
 StdPreferences (const StdPreferences &oSource) noexcept
 Copy constructor. More...
 
StdPreferencesoperator= (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< PrefTeamgetTeam (int32_t nTeam) const noexcept override
 Get team by number. More...
 
const shared_ptr< PrefTeamgetTeam (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< PrefPlayergetPlayer (int32_t nPlayer) const noexcept override
 Get player by number. More...
 
const shared_ptr< PrefPlayergetPlayer (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::ClassgetCapabilityClasses () 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::CapabilitygetCapabilityFromClassDeviceIdx (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
 

Constructor & Destructor Documentation

◆ AllPreferences() [1/2]

stmg::AllPreferences::AllPreferences ( const shared_ptr< StdConfig > &  refStdConfig)
explicitnoexcept

Constructor.

See also
StdPreferences::StdPreferences(...)

The instance is created in edit mode.

Parameters
refStdConfigThe configuration. Cannot be null.

◆ AllPreferences() [2/2]

stmg::AllPreferences::AllPreferences ( const AllPreferences oSource)
noexcept

Copy constructor.

Parameters
oSourceThe source.

Member Function Documentation

◆ addGameToPlayedHistory()

void stmg::AllPreferences::addGameToPlayedHistory ( const std::string &  sGameName)
noexcept

Add game to the played history.

The game names are only checked syntactically.

Parameters
sGameNameThe game name. Must be a valid game name.

◆ getGameName()

std::string stmg::AllPreferences::getGameName ( ) const
inlinenoexcept

Get the chosen game name.

Returns
The name or empty if not set.

◆ getPlayedGameHistory()

const std::vector<std::string>& stmg::AllPreferences::getPlayedGameHistory ( ) const
inlinenoexcept

The current played games history.

Returns
The game names in last played order.

◆ getThemeName()

std::string stmg::AllPreferences::getThemeName ( ) const
inlinenoexcept

Get the chosen theme name.

Returns
The name or empty if not set.

◆ operator=()

AllPreferences& stmg::AllPreferences::operator= ( const AllPreferences oSource)
noexcept

Copy assignment.

Parameters
oSourceThe source.
Returns
The instance.

◆ setGameName()

void stmg::AllPreferences::setGameName ( const std::string &  sGameName)
inlinenoexcept

Set game name.

The name must be known to the game loader or empty.

Parameters
sGameNameThe name of the chosen game. Can be empty.

◆ setThemeName()

void stmg::AllPreferences::setThemeName ( const std::string &  sThemeName)
inlinenoexcept

Set theme name.

The name must be known to the theme loader or empty.

Parameters
sThemeNameThe name of the chosen theme. Can be empty.