CCIMXDesktop
 
Loading...
Searching...
No Matches
DifficultyManager Class Reference

Manages game difficulty levels and their transitions. More...

#include <DifficultyManager.h>

Inheritance diagram for DifficultyManager:

Signals

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.
 

Public Member Functions

 DifficultyManager (QObject *parent=nullptr)
 Constructs a DifficultyManager object.
 
void upgrade_difficulty ()
 Upgrades the game difficulty to the next level.
 
void set_auto_update (bool st)
 Enables or disables automatic difficulty updates.
 
void force_reset ()
 Resets the difficulty to the initial level (EASY)
 
Difficulty get_current_difficulty () const
 Gets the current difficulty level.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DifficultyManager()

DifficultyManager::DifficultyManager ( QObject *  parent = nullptr)
explicit

Constructs a DifficultyManager object.

Parameters
parentThe parent QObject (optional)

Member Function Documentation

◆ difficulty_changed

void DifficultyManager::difficulty_changed ( Difficulty  difficulty)
signal

Signal emitted when the difficulty level changes.

Parameters
difficultyThe 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_speedThe 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_speedThe new maximum obstacle count

◆ set_auto_update()

void DifficultyManager::set_auto_update ( bool  st)

Enables or disables automatic difficulty updates.

Parameters
stTrue 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: