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 <libkdegames_export.h>
00023
00024
00025
00074 class KDEGAMES_EXPORT KGameDifficulty
00075 {
00076 public:
00082 enum onChange {
00083 RestartOnChange,
00084 NoRestartOnChange
00085 };
00086
00092 enum standardLevel {
00093 RidiculouslyEasy = 10,
00094 VeryEasy = 20,
00095 Easy = 30,
00096 Medium = 40,
00097 Hard = 50,
00098 VeryHard = 60,
00099 ExtremelyHard = 70,
00100 Impossible = 80,
00101 Configurable = 90,
00102 Custom = 100,
00103 NoLevel = 110
00104 };
00105
00106
00110 virtual ~KGameDifficulty();
00111
00122 static void init(KXmlGuiWindow* window, const QObject *recvr, const char* slotStandard, const char* slotCustom = 0);
00123
00130 static void setRestartOnChange(onChange restart);
00131
00139 static void addStandardLevel(standardLevel level);
00140
00146 static void removeStandardLevel(standardLevel level);
00147
00156 static void addCustomLevel(int key, const QString& appellation);
00157
00163 static void removeCustomLevel(int key);
00164
00172 static void setEnabled(bool enabled);
00173
00179 static void setLevel(standardLevel level);
00180
00186 static standardLevel level();
00190 static QString levelString();
00197 static void setLevelCustom(int key);
00198
00205 static int levelCustom();
00206
00214 static void setRunning(bool running);
00215
00216
00217 private:
00221 KGameDifficulty();
00228 static KGameDifficulty* self();
00229
00230 static KGameDifficulty* instance;
00231 friend class KGameDifficultyPrivate;
00232 KGameDifficultyPrivate* const d;
00233
00234 Q_DISABLE_COPY(KGameDifficulty)
00235 };
00236
00237 #endif //KGAMEDIFFICULTY_H