#pragma once #include #include namespace vl::reflect { // Generator fills these specializations for every discoverable method pointer. template struct method_info { static_assert(sizeof(MethodPtr) == 0, "No reflection metadata found for this method pointer. " "Did you include the generated header for this class?"); static constexpr std::string_view owner = ""; // "net/minecraft/.../LocalPlayer" static constexpr std::string_view name = ""; // "tick" static constexpr std::string_view desc = ""; // "()V" static constexpr bool is_static = false; }; template constexpr bool is_valid_method() { // If the primary template is instantiated, owner=="" and will trip this. return method_info::owner.size() > 0; } template constexpr std::string_view method_owner() { return method_info::owner; } template constexpr std::string_view method_name() { return method_info::name; } template constexpr std::string_view method_desc() { return method_info::desc; } template constexpr bool method_is_static() { return method_info::is_static; } } // namespace vl::reflect