libkdegames
kgamedifficulty.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef KGAMEDIFFICULTY_H
00013 #define KGAMEDIFFICULTY_H
00014
00015
00016
00017 class QObject;
00018
00019
00020 class KGameDifficultyPrivate;
00021 class KXmlGuiWindow;
00022 #include <QtCore/QMap>
00023 #include <QtCore/QPair>
00024 #include <libkdegames_export.h>
00025
00026
00027
00078 class KDEGAMES_EXPORT KGameDifficulty
00079 {
00080 public:
00086 enum onChange {
00087 RestartOnChange,
00088 NoRestartOnChange
00089 };
00090
00096 enum standardLevel {
00097 RidiculouslyEasy = 10,
00098 VeryEasy = 20,
00099 Easy = 30,
00100 Medium = 40,
00101 Hard = 50,
00102 VeryHard = 60,
00103 ExtremelyHard = 70,
00104 Impossible = 80,
00105 Configurable = 90,
00106 Custom = 100,
00107 NoLevel = 110
00108 };
00109
00110
00114 virtual ~KGameDifficulty();
00115
00126 static void init(KXmlGuiWindow* window, const QObject *recvr, const char* slotStandard, const char* slotCustom = 0);
00127
00134 static void setRestartOnChange(onChange restart);
00135
00143 static void addStandardLevel(standardLevel level);
00144
00150 static void removeStandardLevel(standardLevel level);
00151
00160 static void addCustomLevel(int key, const QString& appellation);
00161
00167 static void removeCustomLevel(int key);
00168
00176 static void setEnabled(bool enabled);
00177
00183 static void setLevel(standardLevel level);
00184
00190 static standardLevel level();
00194 static QString levelString();
00198 static QPair<QByteArray, QString> localizedLevelString();
00202 static QMap<QByteArray, QString> localizedLevelStrings();
00209 static void setLevelCustom(int key);
00210
00217 static int levelCustom();
00218
00226 static void setRunning(bool running);
00227
00228
00229 private:
00233 KGameDifficulty();
00240 static KGameDifficulty* self();
00241
00242 static KGameDifficulty* instance;
00243 friend class KGameDifficultyPrivate;
00244 KGameDifficultyPrivate* const d;
00245
00246 Q_DISABLE_COPY(KGameDifficulty)
00247 };
00248
00249 #endif //KGAMEDIFFICULTY_H