#ifndef CONFIG_MGR_H #define CONFIG_MGR_H #include #include #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); std::shared_ptr GetSlotPtr(int slot); void AddCard(std::shared_ptr ptr); private: QString filename_; int card_type_[15]; std::vector> cards_; }; #endif // CONFIG_MGR_H