• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames

kgamedifficulty.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2007, Nicolas Roffet, <nicolas-kde@roffet.com>
00003 Copyright (c) 2007, Pino Toscano, <toscano.pino@tiscali.it>
00004 
00005 This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
00006 
00007 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for more details.
00008 
00009 You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
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

libkdegames

Skip menu "libkdegames"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal