3#include "ll/api/reflection/TypeName.h"
4#include "mc/nbt/CompoundTag.h"
8[[nodiscard]] inline ::CompoundTag serializeRefObj(T& obj) {
10 {
"_nullable_",
false},
11 {
"_pointer_", (uintptr_t)std::addressof(obj)},
12 {
"_type_", reflection::type_unprefix_name_v<std::remove_cvref_t<T>>},
13 {
"_isconst_", std::is_const_v<T>},
17[[nodiscard]] inline ::CompoundTag serializePtrObj(T* ptr) {
20 {
"_pointer_", (uintptr_t)ptr},
21 {
"_type_", reflection::type_unprefix_name_v<std::remove_cvref_t<T>>},
22 {
"_isconst_", std::is_const_v<T>},
25[[nodiscard]]
inline bool isEventSerializedObj(
::CompoundTag const& tag) {
26 return tag.contains(
"_type_") && tag.contains(
"_pointer_");
29 return tag.is_object() ? isEventSerializedObj(tag.get<
::CompoundTag>()) : false;
Definition CompoundTagVariant.h:38
Definition CompoundTag.h:13