Player12
An open source football management simulator
Loading...
Searching...
No Matches
SettingsManager Class Reference

Singleton class that manages the application settings. More...

#include <settings_manager.h>

Public Member Functions

void load ()
 Loads the settings from the configuration file.
 
void save () const
 Saves the current settings to the configuration file.
 
void apply (SDL_Window *window)
 Applies the current settings to the given SDL window.
 
Settings & get ()
 Gets a reference to the current settings.
 
const Settings & get () const
 Gets a const reference to the current settings.
 
Settings & getSettings ()
 Gets a reference to the current settings.
 

Static Public Member Functions

static SettingsManager * instance ()
 Gets the singleton instance of the SettingsManager.
 

Private Member Functions

 SettingsManager ()
 

Private Attributes

Settings settings_
 

Detailed Description

Singleton class that manages the application settings.

Constructor & Destructor Documentation

◆ SettingsManager()

SettingsManager::SettingsManager ( )
private

Member Function Documentation

◆ apply()

void SettingsManager::apply ( SDL_Window *  window)

Applies the current settings to the given SDL window.

Parameters
windowPointer to the SDL_Window to apply settings to.

◆ get() [1/2]

Settings & SettingsManager::get ( )
inline

Gets a reference to the current settings.

Returns
Reference to the Settings object.

◆ get() [2/2]

const Settings & SettingsManager::get ( ) const
inline

Gets a const reference to the current settings.

Returns
Const reference to the Settings object.

◆ getSettings()

Settings & SettingsManager::getSettings ( )
inline

Gets a reference to the current settings.

Returns
Reference to the Settings object.

◆ instance()

SettingsManager * SettingsManager::instance ( )
static

Gets the singleton instance of the SettingsManager.

Returns
Pointer to the SettingsManager instance.

◆ load()

void SettingsManager::load ( )

Loads the settings from the configuration file.

◆ save()

void SettingsManager::save ( ) const

Saves the current settings to the configuration file.

Member Data Documentation

◆ settings_

Settings SettingsManager::settings_
private

The documentation for this class was generated from the following files: