#pragma once #include "Psc_Cpp_Core/Base/JSON.h" #include "adminive/managed.hpp" struct MLAT_Config_Data { bool merge{}; PSC_USE_JSON }; namespace adminive { template <> struct Type_Descriptor { static auto get() { using T = MLAT_Config_Data; return object("mlat_config", "MLAT 配置", ADMINIVE_FIELD_LABEL(T, merge, "合并 MLAT").editable().boolean_input()); } }; } class MLAT_Config { public: adminive::Managed_Value settings; [[nodiscard]] Psc::JSON to_base_json() const { return settings.read([](const auto& value) { return value.to_base_json(); }); } void from_json(const Psc::JSON* that_json, bool not_exist_use_default_value) { settings.write([&](auto& value) { value.from_base_json(that_json, not_exist_use_default_value); }); } };