libkdegames
kgdifficulty.cpp
Go to the documentation of this file.
47 Private(int hardness, const QByteArray& key, const QString& title, StandardLevel level, bool isDefault);
51 KgDifficultyLevel::KgDifficultyLevel(int hardness, const QByteArray& key, const QString& title, bool isDefault)
56 KgDifficultyLevel::Private::Private(int hardness, const QByteArray& key, const QString& title, StandardLevel level, bool isDefault)
70 KgDifficultyLevel::Private* KgDifficultyLevel::Private::fromStandardLevel(KgDifficultyLevel::StandardLevel level, bool isDefault)
76 //The first entry in the pair is to be used as a key so don't change it. It doesn't have to match the string to be translated
81 data = qMakePair(QByteArray("Ridiculously Easy"), i18nc("Game difficulty level 1 out of 8", "Ridiculously Easy"));
84 data = qMakePair(QByteArray("Very Easy"), i18nc("Game difficulty level 2 out of 8", "Very Easy"));
96 data = qMakePair(QByteArray("Very Hard"), i18nc("Game difficulty level 6 out of 8", "Very Hard"));
99 data = qMakePair(QByteArray("Extremely Hard"), i18nc("Game difficulty level 7 out of 8", "Extremely Hard"));
102 data = qMakePair(QByteArray("Impossible"), i18nc("Game difficulty level 8 out of 8", "Impossible"));
226 Q_ASSERT_X(fromIndex >= 0 && toIndex > fromIndex && (defaultLevelIndex == KgDifficultyLevel::Custom || (defaultLevelIndex >= fromIndex && defaultLevelIndex <= toIndex)),
391 KSelectAction* menu = new KgDifficultyGUI::Menu(icon, i18nc("Game difficulty level", "Difficulty"), window);
standardLevel() returns this for custom levels.
Definition: kgdifficulty.h:46
void selectedLevelChanged(const KgDifficultyLevel *level)
Emitted after every call to select(), even when the user has rejected the change. ...
void setEditable(bool editable)
Set whether the difficulty level selection may be edited.
Definition: kgdifficulty.cpp:275
void gameRunningChanged(bool gameRunning)
Emitted when a running game has been marked or unmarked.
const KgDifficultyLevel * currentLevel() const
void currentLevelChanged(const KgDifficultyLevel *level)
Emitted when a new difficulty level has been selected.
int indexOf(const T &value, int from) const
Definition: kgdifficulty.h:51
void addLevel(KgDifficultyLevel *level)
Adds a difficulty level to this instance.
Definition: kgdifficulty.cpp:178
KgDifficultyLevel(int hardness, const QByteArray &key, const QString &title, bool isDefault=false)
Refer to the getters' documentation for details on the params.
Definition: kgdifficulty.cpp:51
QList< const KgDifficultyLevel * > levels() const
Definition: kgdifficulty.cpp:236
Definition: kgdifficulty.h:48
Definition: kgdifficulty.h:50
void addStandardLevel(KgDifficultyLevel::StandardLevel level, bool isDefault=false)
A shortcut for addLevel(new KgDifficultyLevel(level)).
Definition: kgdifficulty.cpp:200
StandardLevel standardLevel() const
void addStandardLevelRange(KgDifficultyLevel::StandardLevel from, KgDifficultyLevel::StandardLevel to)
This convenience method adds a range of standard levels to this instance (including the boundaries)...
Definition: kgdifficulty.cpp:205
KDEGAMES_EXPORT KgDifficultyLevel::StandardLevel difficultyLevel()
A shortcut for Kg::difficulty()->currentLevel()->standardLevel().
Definition: kgdifficulty.cpp:334
void setParent(QObject *parent)
void editableChanged(bool editable)
Emitted when the editability changes.
int hardness() const
virtual ~KgDifficulty()
Destroys this instance and all DifficultyLevel instances in it.
Definition: kgdifficulty.cpp:160
Definition: kgdifficulty.h:54
void setGameRunning(bool running)
KgDifficulty has optional protection against changing the difficulty level while a game is running...
Definition: kgdifficulty.cpp:290
void select(const KgDifficultyLevel *level)
Select a new difficulty level.
Definition: kgdifficulty.cpp:300
KDEGAMES_EXPORT void init(KXmlGuiWindow *window, KgDifficulty *difficulty=0)
Install standard GUI components for the manipulation of the given KgDifficulty instance in the given ...
Definition: kgdifficulty.cpp:374
Definition: kgdifficulty.h:33
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
Definition: kgdifficulty.h:52
KgDifficulty manages difficulty levels of a game in a standard way.
Definition: kgdifficulty.h:96
QByteArray key() const
QString title() const
Definition: kgdifficulty.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.