dl
dl_mod.h
浏览该文件的文档.
1
12#pragma once
13
14#ifndef DL_DISABLE_RENDER
15#include "io/dl_json.h"
16
17namespace dl
18{
20class Mod
21{
22 friend class ModManager;
23public:
24 enum class State
25 {
26 ERR, // 错误
27 DISABLE, // 未启用
28 NORMAL, // 正常
29 };
30 Mod();
31private:
32 //-------------------------config-------------------------
33 uint64_t _uid;
34 std::string _name;
35 std::string _author;
36 std::string _versionType;
37 std::array<size_t, 3> _versionCode;
38
39 size_t _id;
40 State _state;
41 std::string _pathRoot;// 根目录
42
43 bool _load_config(json& j);
44};
45
47{
48public:
54 void LoadMod(std::string_view path);
55
56 void LoadModAll(std::string_view path);
57private:
58 std::vector<Mod> _allMod;
59};
60
61extern ModManager* g_mod;
62}
63#endif
friend class ModManager
模组管理器
void LoadMod(std::string_view path)
加载模组
void LoadModAll(std::string_view path)
json格式相关
nlohmann::json json
ModManager * g_mod