TSI_Config/config_mgr.h
2025-03-29 18:05:12 +08:00

31 lines
622 B
C++

#ifndef CONFIG_MGR_H
#define CONFIG_MGR_H
#include <memory>
#include <vector>
#include "cardbase.h"
class ConfigMgr {
private:
static ConfigMgr *instance;
ConfigMgr() {
for (int i = 0; i < SLOT_NUM; ++i) {
card_type_[i] = kCardNone;
}
}
public:
static ConfigMgr *Instance() {
if (instance == nullptr) {
instance = new ConfigMgr();
}
return instance;
}
~ConfigMgr();
void Save();
void Load(QString filename);
private:
int card_type_[15];
std::vector<std::shared_ptr<CardBase>> cards_;
};
#endif // CONFIG_MGR_H