Update StarLuaConverters.hpp

This commit is contained in:
Bottinator22 2024-12-28 20:09:29 -08:00 committed by GitHub
parent 922427e25f
commit ec6c8f0c3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -168,11 +168,11 @@ struct LuaConverter<Line<T, N>> {
template <typename FirstType, typename... RestTypes> template <typename FirstType, typename... RestTypes>
struct LuaConverter<Variant<FirstType, RestTypes...>> { struct LuaConverter<Variant<FirstType, RestTypes...>> {
static LuaValue from(LuaEngine& engine, Variant<FirstType, RestTypes...> const& variant) { static LuaValue from(LuaEngine& engine, Variant<FirstType, RestTypes...> const& variant) {
return variant.call([&engine](auto const& a) { return luaFrom(engine, a); }); return variant.call([&engine](auto const& a) { return engine.luaFrom(a); });
} }
static LuaValue from(LuaEngine& engine, Variant<FirstType, RestTypes...>&& variant) { static LuaValue from(LuaEngine& engine, Variant<FirstType, RestTypes...>&& variant) {
return variant.call([&engine](auto& a) { return luaFrom(engine, std::move(a)); }); return variant.call([&engine](auto& a) { return engine.luaFrom(std::move(a)); });
} }
static Maybe<Variant<FirstType, RestTypes...>> to(LuaEngine& engine, LuaValue const& v) { static Maybe<Variant<FirstType, RestTypes...>> to(LuaEngine& engine, LuaValue const& v) {
@ -217,7 +217,7 @@ struct LuaConverter<MVariant<Types...>> {
static LuaValue from(LuaEngine& engine, MVariant<Types...> const& variant) { static LuaValue from(LuaEngine& engine, MVariant<Types...> const& variant) {
LuaValue value; LuaValue value;
variant.call([&value, &engine](auto const& a) { variant.call([&value, &engine](auto const& a) {
value = luaFrom(engine, a); value = engine.luaFrom(a);
}); });
return value; return value;
} }
@ -225,7 +225,7 @@ struct LuaConverter<MVariant<Types...>> {
static LuaValue from(LuaEngine& engine, MVariant<Types...>&& variant) { static LuaValue from(LuaEngine& engine, MVariant<Types...>&& variant) {
LuaValue value; LuaValue value;
variant.call([&value, &engine](auto& a) { variant.call([&value, &engine](auto& a) {
value = luaFrom(engine, std::move(a)); value = engine.luaFrom(std::move(a));
}); });
return value; return value;
} }