• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames/libkdegamesprivate

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
  • libkdegamesprivate
kgamedifficulty.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2007, Nicolas Roffet, <nicolas-kde@roffet.com>
3 Copyright (c) 2007, Pino Toscano, <toscano.pino@tiscali.it>
4 
5 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.
6 
7 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.
8 
9 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
10 */
11 
12 #ifndef KGAMEDIFFICULTY_H
13 #define KGAMEDIFFICULTY_H
14 
15 
16 
17 class QObject;
18 
19 
20 class KGameDifficultyPrivate;
21 class KXmlGuiWindow;
22 #include <QtCore/QMap>
23 #include <QtCore/QPair>
24 #include "libkdegamesprivate_export.h"
25 
26 
27 
78 class KDEGAMESPRIVATE_EXPORT KGameDifficulty
79 {
80  public:
86  enum onChange {
87  RestartOnChange,
88  NoRestartOnChange
89  };
90 
96  enum standardLevel {
97  RidiculouslyEasy = 10,
98  VeryEasy = 20,
99  Easy = 30,
100  Medium = 40,
101  Hard = 50,
102  VeryHard = 60,
103  ExtremelyHard = 70,
104  Impossible = 80,
105  Configurable = 90,
106  Custom = 100,
107  NoLevel = 110
108  };
109 
110 
114  virtual ~KGameDifficulty();
115 
126  static void init(KXmlGuiWindow* window, const QObject *recvr, const char* slotStandard, const char* slotCustom = 0);
127 
134  static void setRestartOnChange(onChange restart);
135 
143  static void addStandardLevel(standardLevel level);
144 
150  static void removeStandardLevel(standardLevel level);
151 
160  static void addCustomLevel(int key, const QString& appellation);
161 
167  static void removeCustomLevel(int key);
168 
176  static void setEnabled(bool enabled);
177 
183  static void setLevel(standardLevel level);
184 
190  static standardLevel level();
194  static QString levelString();
198  static QPair<QByteArray, QString> localizedLevelString();
202  static QMap<QByteArray, QString> localizedLevelStrings();
207  static QMap<int, QByteArray> levelWeights();
214  static void setLevelCustom(int key);
215 
222  static int levelCustom();
223 
231  static void setRunning(bool running);
232 
233 
234  private:
238  KGameDifficulty();
245  static KGameDifficulty* self();
246 
247  static KGameDifficulty* instance;
248  friend class KGameDifficultyPrivate;
249  KGameDifficultyPrivate* const d;
250 
251  Q_DISABLE_COPY(KGameDifficulty)
252 };
253 
254 #endif //KGAMEDIFFICULTY_H
KDEGAMESPRIVATE_EXPORT
#define KDEGAMESPRIVATE_EXPORT
Definition: libkdegamesprivate_export.h:46
QMap
KGameDifficulty
KGameDifficuty manages the game difficulty levels in a standard way.
Definition: kgamedifficulty.h:78
libkdegamesprivate_export.h
QObject
QString
QPair
KGameDifficulty::onChange
onChange
Behavior on change.
Definition: kgamedifficulty.h:86
KGameDifficulty::standardLevel
standardLevel
Standard difficulty levels.
Definition: kgamedifficulty.h:96
KGameDifficulty::RestartOnChange
The current game has to be canceled and a new game will be started on change.
Definition: kgamedifficulty.h:87
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames/libkdegamesprivate

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

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal