You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1 KiB

#ifndef SESSION_MANAGER_H_
#define SESSION_MANAGER_H_
#include <string>
#include "question_generator.h"
#include "primary_generator.h"
#include "junior_generator.h"
#include "senior_generator.h"
class SessionManager {
public:
SessionManager();
// 设置当前用户和难度
void SetUser(const std::string& username, const std::string& difficulty);
// 切换难度级别
bool SwitchDifficulty(const std::string& difficulty);
// 获取当前题目生成器
QuestionGenerator* GetCurrentGenerator();
// 获取当前难度描述
std::string GetCurrentDifficulty() const;
// 获取当前用户名
std::string GetCurrentUser() const;
private:
std::string current_user_;
std::string current_difficulty_;
QuestionGenerator* current_generator_;
PrimaryGenerator primary_generator_;
JuniorGenerator junior_generator_;
SeniorGenerator senior_generator_;
// 禁用拷贝构造和赋值操作
SessionManager(const SessionManager&) = delete;
SessionManager& operator=(const SessionManager&) = delete;
};
#endif // SESSION_MANAGER_H_