Manages game difficulty levels and their transitions.
More...
#include <DifficultyManager.h>
|
void | difficulty_changed (Difficulty difficulty) |
| Signal emitted when the difficulty level changes.
|
|
void | new_move_speed (const int new_speed) |
| Signal emitted when the movement speed changes.
|
|
void | new_obstacle_cnt_max (const int new_speed) |
| Signal emitted when the maximum obstacle count changes.
|
|
Manages game difficulty levels and their transitions.
The DifficultyManager class handles the current difficulty level of the game, provides functionality to upgrade difficulty, and emits signals when difficulty parameters change. It supports both manual and automatic difficulty updates.
◆ DifficultyManager()
DifficultyManager::DifficultyManager |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
Constructs a DifficultyManager object.
- Parameters
-
parent | The parent QObject (optional) |
◆ difficulty_changed
void DifficultyManager::difficulty_changed |
( |
Difficulty |
difficulty | ) |
|
|
signal |
Signal emitted when the difficulty level changes.
- Parameters
-
difficulty | The new difficulty level |
◆ force_reset()
void DifficultyManager::force_reset |
( |
| ) |
|
Resets the difficulty to the initial level (EASY)
This is a forced reset that immediately changes the difficulty regardless of any timers or auto-update settings.
◆ get_current_difficulty()
Difficulty DifficultyManager::get_current_difficulty |
( |
| ) |
const |
|
inline |
Gets the current difficulty level.
- Returns
- The current Difficulty enum value
◆ new_move_speed
void DifficultyManager::new_move_speed |
( |
const int |
new_speed | ) |
|
|
signal |
Signal emitted when the movement speed changes.
- Parameters
-
new_speed | The new movement speed value |
◆ new_obstacle_cnt_max
void DifficultyManager::new_obstacle_cnt_max |
( |
const int |
new_speed | ) |
|
|
signal |
Signal emitted when the maximum obstacle count changes.
- Parameters
-
new_speed | The new maximum obstacle count |
◆ set_auto_update()
void DifficultyManager::set_auto_update |
( |
bool |
st | ) |
|
Enables or disables automatic difficulty updates.
- Parameters
-
st | True to enable auto-update, false to disable |
◆ upgrade_difficulty()
void DifficultyManager::upgrade_difficulty |
( |
| ) |
|
Upgrades the game difficulty to the next level.
If the current difficulty is already at the highest level, this function will have no effect.
The documentation for this class was generated from the following files:
- extern_app/games/CCIMX_DinoGame/core/DifficultyManager.h
- extern_app/games/CCIMX_DinoGame/core/DifficultyManager.cpp