CCIMXDesktop
 
Loading...
Searching...
No Matches
DifficultyManager.h
1#ifndef DIFFICULTYMANAGER_H
2#define DIFFICULTYMANAGER_H
3
4#include "core/DifficultyType.h"
5#include <QObject>
6class QTimer;
15class DifficultyManager : public QObject {
16 Q_OBJECT
17public:
22 explicit DifficultyManager(QObject* parent = nullptr);
23
30 void upgrade_difficulty();
31
36 void set_auto_update(bool st);
37
44 void force_reset();
45
50 Difficulty get_current_difficulty() const { return current_difficulty; }
51
52signals:
57 void difficulty_changed(Difficulty difficulty);
58
63 void new_move_speed(const int new_speed);
64
69 void new_obstacle_cnt_max(const int new_speed);
70
71private slots:
78 void process_difficulty_changed();
79
80private:
81 Difficulty current_difficulty { Difficulty::EASY };
82 QTimer* auto_update_timer;
83};
84
85#endif // DIFFICULTYMANAGER_H
Manages game difficulty levels and their transitions.
Definition DifficultyManager.h:15
void upgrade_difficulty()
Upgrades the game difficulty to the next level.
Definition DifficultyManager.cpp:16
Difficulty get_current_difficulty() const
Gets the current difficulty level.
Definition DifficultyManager.h:50
void new_obstacle_cnt_max(const int new_speed)
Signal emitted when the maximum obstacle count changes.
void new_move_speed(const int new_speed)
Signal emitted when the movement speed changes.
void force_reset()
Resets the difficulty to the initial level (EASY)
Definition DifficultyManager.cpp:34
void set_auto_update(bool st)
Enables or disables automatic difficulty updates.
Definition DifficultyManager.cpp:26
void difficulty_changed(Difficulty difficulty)
Signal emitted when the difficulty level changes.