mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-28 14:47:11 -07:00
* [Settings] Split cache_settings into multiple files Took 9 minutes Took 4 minutes * [Settings] Fwd declare settings classes in cache_settings Took 15 minutes * Fix oracle includes. Took 8 minutes * Address comments, fix windows CI Took 8 minutes * fix copy constructor visibility Took 3 minutes * lint Took 2 minutes * Fix native format tests. Took 5 minutes * Remove test header guard Took 4 seconds * Remove tests invalid in CI environ Took 24 seconds * Adjust to rebase. Took 11 minutes * Change settings file name. Took 8 minutes --------- Co-authored-by: Lukas Brübach <lukas.bruebach@bdosecurity.de> Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
167 lines
4.1 KiB
C++
167 lines
4.1 KiB
C++
#include "game_settings.h"
|
|
|
|
GameSettings::GameSettings(const QString &settingPath, QObject *parent)
|
|
: SettingsManager(settingPath + "game.ini", QString(), QString(), parent)
|
|
{
|
|
}
|
|
|
|
QString GameSettings::getGameDescription() const
|
|
{
|
|
return getValue("gamedescription", "game").toString();
|
|
}
|
|
|
|
int GameSettings::getMaxPlayers() const
|
|
{
|
|
return getValue("maxplayers", "game", QString(), 2).toInt();
|
|
}
|
|
|
|
QString GameSettings::getGameTypes() const
|
|
{
|
|
return getValue("gametypes", "game").toString();
|
|
}
|
|
|
|
bool GameSettings::getOnlyBuddies() const
|
|
{
|
|
return getValue("onlybuddies", "game").toBool();
|
|
}
|
|
|
|
bool GameSettings::getOnlyRegistered() const
|
|
{
|
|
return getValue("onlyregistered", "game").toBool();
|
|
}
|
|
|
|
bool GameSettings::getSpectatorsAllowed() const
|
|
{
|
|
return getValue("spectatorsallowed", "game").toBool();
|
|
}
|
|
|
|
bool GameSettings::getSpectatorsNeedPassword() const
|
|
{
|
|
return getValue("spectatorsneedpassword", "game").toBool();
|
|
}
|
|
|
|
bool GameSettings::getSpectatorsCanTalk() const
|
|
{
|
|
return getValue("spectatorscantalk", "game").toBool();
|
|
}
|
|
|
|
bool GameSettings::getSpectatorsCanSeeEverything() const
|
|
{
|
|
return getValue("spectatorscanseeeverything", "game").toBool();
|
|
}
|
|
|
|
bool GameSettings::getCreateGameAsSpectator() const
|
|
{
|
|
return getValue("creategameasspectator", "game").toBool();
|
|
}
|
|
|
|
int GameSettings::getDefaultStartingLifeTotal() const
|
|
{
|
|
return getValue("defaultstartinglifetotal", "game", QString(), 20).toInt();
|
|
}
|
|
|
|
bool GameSettings::getShareDecklistsOnLoad() const
|
|
{
|
|
return getValue("sharedecklistsonload", "game").toBool();
|
|
}
|
|
|
|
bool GameSettings::getRememberGameSettings() const
|
|
{
|
|
return getValue("remembergamesettings", "game", QString(), true).toBool();
|
|
}
|
|
|
|
bool GameSettings::getLocalGameRememberSettings() const
|
|
{
|
|
return getValue("remembersettings", "localgameoptions").toBool();
|
|
}
|
|
|
|
int GameSettings::getLocalGameMaxPlayers() const
|
|
{
|
|
return getValue("maxplayers", "localgameoptions", QString(), 1).toInt();
|
|
}
|
|
|
|
int GameSettings::getLocalGameStartingLifeTotal() const
|
|
{
|
|
return getValue("startinglifetotal", "localgameoptions", QString(), 20).toInt();
|
|
}
|
|
|
|
void GameSettings::setGameDescription(const QString &_gameDescription)
|
|
{
|
|
setValue(_gameDescription, "gamedescription", "game");
|
|
}
|
|
|
|
void GameSettings::setMaxPlayers(int _maxPlayers)
|
|
{
|
|
setValue(_maxPlayers, "maxplayers", "game");
|
|
}
|
|
|
|
void GameSettings::setGameTypes(const QString &_gameTypes)
|
|
{
|
|
setValue(_gameTypes, "gametypes", "game");
|
|
}
|
|
|
|
void GameSettings::setOnlyBuddies(bool _onlyBuddies)
|
|
{
|
|
setValue(_onlyBuddies, "onlybuddies", "game");
|
|
}
|
|
|
|
void GameSettings::setOnlyRegistered(bool _onlyRegistered)
|
|
{
|
|
setValue(_onlyRegistered, "onlyregistered", "game");
|
|
}
|
|
|
|
void GameSettings::setSpectatorsAllowed(bool _spectatorsAllowed)
|
|
{
|
|
setValue(_spectatorsAllowed, "spectatorsallowed", "game");
|
|
}
|
|
|
|
void GameSettings::setSpectatorsNeedPassword(bool _spectatorsNeedPassword)
|
|
{
|
|
setValue(_spectatorsNeedPassword, "spectatorsneedpassword", "game");
|
|
}
|
|
|
|
void GameSettings::setSpectatorsCanTalk(bool _spectatorsCanTalk)
|
|
{
|
|
setValue(_spectatorsCanTalk, "spectatorscantalk", "game");
|
|
}
|
|
|
|
void GameSettings::setSpectatorsCanSeeEverything(bool _spectatorsCanSeeEverything)
|
|
{
|
|
setValue(_spectatorsCanSeeEverything, "spectatorscanseeeverything", "game");
|
|
}
|
|
|
|
void GameSettings::setCreateGameAsSpectator(bool _createGameAsSpectator)
|
|
{
|
|
setValue(_createGameAsSpectator, "creategameasspectator", "game");
|
|
}
|
|
|
|
void GameSettings::setDefaultStartingLifeTotal(int _defaultStartingLifeTotal)
|
|
{
|
|
setValue(_defaultStartingLifeTotal, "defaultstartinglifetotal", "game");
|
|
}
|
|
|
|
void GameSettings::setShareDecklistsOnLoad(bool _shareDecklistsOnLoad)
|
|
{
|
|
setValue(_shareDecklistsOnLoad, "sharedecklistsonload", "game");
|
|
}
|
|
|
|
void GameSettings::setRememberGameSettings(bool _rememberGameSettings)
|
|
{
|
|
setValue(_rememberGameSettings, "remembergamesettings", "game");
|
|
}
|
|
|
|
void GameSettings::setLocalGameRememberSettings(bool value)
|
|
{
|
|
setValue(value, "remembersettings", "localgameoptions");
|
|
}
|
|
|
|
void GameSettings::setLocalGameMaxPlayers(int value)
|
|
{
|
|
setValue(value, "maxplayers", "localgameoptions");
|
|
}
|
|
|
|
void GameSettings::setLocalGameStartingLifeTotal(int value)
|
|
{
|
|
setValue(value, "startinglifetotal", "localgameoptions");
|
|
}
|