1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- //
- // GameConf.hpp
- // CandyCookie
- //
- // Created by 徐炼新 on 2021/6/29.
- //
- #ifndef BaseConf_hpp
- #define BaseConf_hpp
- #include "cocos2d.h"
- #include "RUDefine.h"
- USING_NS_CC;
- NS_RU_BEGIN
- class BaseConf {
- public:
- BaseConf(const char*);
-
- /// 获取某项配置
- /// @param group 组名
- /// @param confKey 配置项名称,如果有多级则中间用 ":" 连起来
- const string& getConf(const string& group, const string& confKey);
- /// 获取某个分组的某项配置
- /// @param userGrp 用户分组
- /// @param optK 选项的key
- std::string getGrpOptions(int userGrp, const char* optK);
- /// 获取某项配置
- /// @param confKey 单个的配置项名称
- const string& getConf(const string& confKey);
- float getConfAsFloat(const string& confKey);
- float getConfAsFloat(const string& group, const string& confKey);
- std::list<float> getConfAsFloatList(const string& confKey);
- std::list<float> getConfAsFloatList(const string& group, const string& confKey);
-
- bool isValid();
-
- private:
- string _nullV;
- json11::Json _jConf;
- bool _valid = false;
- };
- NS_RU_END
- #endif /* GameConf_hpp */
|