45 auto& lua = entt::locator<sol::state>::value();
47 auto config_type = lua.new_usertype<
Config>(
"Config", sol::no_constructor);
50 config_type[
"set_bool"] = sol::resolve<void(const std::string&, const bool&)>(&
Config::set<bool>);
51 config_type[
"set_int"] = sol::resolve<void(const std::string&, const int&)>(&
Config::set<int>);
52 config_type[
"set_float"] = sol::resolve<void(const std::string&, const float&)>(&
Config::set<float>);
54 config_type[
"set_section_bool"] = sol::resolve<void(const std::string&, const bool&, const std::string&, const std::string&)>(&
Config::set<bool>);
55 config_type[
"set_section_int"] = sol::resolve<void(const std::string&, const int&, const std::string&, const std::string&)>(&
Config::set<int>);
56 config_type[
"set_section_float"] = sol::resolve<void(const std::string&, const float&, const std::string&, const std::string&)>(&
Config::set<float>);
57 config_type[
"set_section_string"] = sol::resolve<void(const std::string&, const std::string&, const std::string&, const std::string&)>(&
Config::set<std::string>);
58 config_type[
"restore_bool"] = sol::resolve<void(const std::string&, const bool&)>(&
Config::restore<bool>);
59 config_type[
"restore_int"] = sol::resolve<void(const std::string&, const int&)>(&
Config::restore<int>);
60 config_type[
"restore_float"] = sol::resolve<void(const std::string&, const float&)>(&
Config::restore<float>);
62 config_type[
"restore_section_bool"] = sol::resolve<void(const std::string&, const bool&, const std::string&, const std::string&)>(&
Config::restore<bool>);
63 config_type[
"restore_section_int"] = sol::resolve<void(const std::string&, const int&, const std::string&, const std::string&)>(&
Config::restore<int>);
64 config_type[
"restore_section_float"] = sol::resolve<void(const std::string&, const float&, const std::string&, const std::string&)>(&
Config::restore<float>);
65 config_type[
"restore_section_string"] =
67 config_type[
"has"] = sol::resolve<bool(const std::string&)>(&
Config::has);
68 config_type[
"has_section"] = sol::resolve<bool(const std::string&, const std::string&, const std::string&)>(&
Config::has);
69 config_type[
"get_bool"] = sol::resolve<std::optional<bool>(
const std::string&)>(&
Config::get<bool>);
70 config_type[
"get_int"] = sol::resolve<std::optional<int>(
const std::string&)>(&
Config::get<int>);
71 config_type[
"get_float"] = sol::resolve<std::optional<float>(
const std::string&)>(&
Config::get<float>);
73 config_type[
"get_section_int"] = sol::resolve<std::optional<int>(
const std::string&,
const std::string&,
const std::string&)>(&
Config::get<int>);
74 config_type[
"get_section_float"] = sol::resolve<std::optional<float>(
const std::string&,
const std::string&,
const std::string&)>(&
Config::get<float>);
75 config_type[
"get_section_string"] = sol::resolve<std::optional<std::string>(
const std::string&,
const std::string&,
const std::string&)>(&
Config::get<std::string>);
76 config_type[
"get_section_bool"] = sol::resolve<std::optional<bool>(
const std::string&,
const std::string&,
const std::string&)>(&
Config::get<bool>);