KGameDifficultyLevel Class

Represents a game's difficulty level. More...

Header: #include <KGameDifficultyLevel>
Inherits: QObject

Public Types

enum StandardLevel { Custom, RidiculouslyEasy, VeryEasy, Easy, Medium, …, Impossible }

Properties

Public Functions

KGameDifficultyLevel(int hardness, const QByteArray &key, const QString &title, bool isDefault = false)
int hardness() const
bool isDefault() const
QByteArray key() const
KGameDifficultyLevel::StandardLevel standardLevel() const
QString title() const

Detailed Description

This class represents a game's difficulty level.

See also KGameDifficulty.

Member Type Documentation

enum KGameDifficultyLevel::StandardLevel

ConstantValueDescription
KGameDifficultyLevel::Custom-1standardLevel() returns this for custom levels.
KGameDifficultyLevel::RidiculouslyEasy10 
KGameDifficultyLevel::VeryEasy20 
KGameDifficultyLevel::Easy30 
KGameDifficultyLevel::Medium40 
KGameDifficultyLevel::Hard50 
KGameDifficultyLevel::VeryHard60 
KGameDifficultyLevel::ExtremelyHard70 
KGameDifficultyLevel::Impossible80 

Property Documentation

[read-only] default : bool

This property holds whether this level is the default level when no selection has been stored (for example on first startup).

Access functions:

bool isDefault() const

[read-only] hardness : int

This property holds a numeric key used to sort the levels by difficulty (smaller values mean easier levels).

Note: For standard levels, this equals the numeric value of the level in the StandardLevel enumeration.

Access functions:

int hardness() const

[read-only] key : QByteArray

This property holds a non-localized key for this level.

Access functions:

QByteArray key() const

[read-only] standardLevel : StandardLevel

This property holds the standard level which was used to create this level, or KGameDifficultyLevel::Custom for custom levels.

Access functions:

KGameDifficultyLevel::StandardLevel standardLevel() const

[read-only] title : QString

This property holds a localized title for this level.

Access functions:

QString title() const

Member Function Documentation

KGameDifficultyLevel::KGameDifficultyLevel(int hardness, const QByteArray &key, const QString &title, bool isDefault = false)

Constructs a KGameDifficultyLevel with hardness, key, title, isDefault.

See also hardness, key, title, and isDefault.