#pragma once
#if !defined(__cppast)
#define __cppast(...)
#else
namespace engineapi {
	//class Asset {};
}
#endif

#define __Meta(...) __cppast(Meta=__VA_ARGS__)
#define UPROPERTY(...) __Meta(__VA_ARGS__)
#define UFUNCTION(...) __Meta(__VA_ARGS__)

#define __vkMeta(...) __cppast(vkMeta=__VA_ARGS__)
#define UPROPERTY_vk(...) __vkMeta(__VA_ARGS__)
#define UFUNCTION_vk(...) __vkMeta(__VA_ARGS__)

#define __dxMeta(...) __cppast(dxMeta=__VA_ARGS__)
#define UPROPERTY_dx(...) __dxMeta(__VA_ARGS__)
#define UFUNCTION_dx(...) __dxMeta(__VA_ARGS__)

// 辅助宏，用于实际拼接
#define CONCATENATE(arg1, arg2)   CONCATENATE_IMPL(arg1, arg2)
#define CONCATENATE_IMPL(arg1, arg2)  arg1##arg2
#define MY_UNIQUE_NAME(base) CONCATENATE(base, __LINE__)

#define USING_CTOR_NAME MY_UNIQUE_NAME(__Ctor)
#define USING_FUNC_NAME MY_UNIQUE_NAME(__Func)

#define USING_OVERLOAD_CTOR(Class, ...) using USING_CTOR_NAME = Class(*)(__VA_ARGS__);
#define USING_OVERLOAD_FUNC(R, ...) using USING_FUNC_NAME = R(*)(__VA_ARGS__);
#define USING_OVERLOAD_CLASS_FUNC(R, Class, ...) using USING_FUNC_NAME = R(Class::*)(__VA_ARGS__);

#define REGISTER_META_TABLE(Class) refl::UClass::MetaTable.emplace(type_name<Class>().View(), &refl::TypeInfo<Class>::StaticClass);

#define REFL_FRIEND(Class) friend class refl_impl::_Static<Class, refl_impl::Meta>;\
friend class refl_impl::_Meta<Class, refl_impl::Meta>;
/*
struct vec3{
	USING_OVERLOAD_CTOR(vec3)
	UFUNCTION({},ref = USING_CTOR_NAME)
	vec3(){}
}
*/
namespace refl_impl {
	struct Meta {};
	struct vkMeta {};
	struct dxMeta {};
}