Revision 1281269

Go back to digest for 26th February 2012

Features in Games

Stefan Majewsky committed changes in /trunk/KDE/kdegames/libkdegames:

Import KgDifficulty class (coming from Project Tagaro).

This is the GUI-independent essence of KGameDifficulty, and a bit more:
* KgDifficulty automatically saves and restores the level selection
across application restarts.
* The levels are virtual base classes, so applications can add more
metadata to them if desired.
* Instead of addStandardLevel (which can be replicated in a one-liner),
there is the incredibly useful addStandardLevelRange call.
* All KgDifficulty capabilities are exposed through Q_PROPERTY, so it's
QML-ready.

Where possible, I tried to retain compatibility to KGameDifficulty, e.g.
in the StandardLevel enum. There are some intentional incompatibilites
though, most notably:

* KGameDifficulty::Configurable has been removed from the StandardLevel
enum. There's only ::Custom.
* setRestartOnChange() has been removed. If you want that behavior, use
setGameRunning(), otherwise just don't.
* The whole localization API has been removed. Iterate over the levels
to retrieve that information if necessary.

File Changes

Added 3 files
  • /trunk/KDE/kdegames/libkdegames
  •   /kgdifficulty.cpp
  •   /kgdifficulty.h
  •   /includes/KgDifficulty
Modified 2 files
  • /trunk/KDE/kdegames/libkdegames
  •   /CMakeLists.txt
  •   /includes/CMakeLists.txt
5 files changed in total