#pragma once
#include "type.h"
#include "guid.h"
#include "resource_bundle.h"
namespace engineapi
{
	struct SerializedMeta
	{
		UPROPERTY({})
		Guid   guid;
		UPROPERTY({})
		string name;
		UPROPERTY({})
		string t_hash{};
		UPROPERTY({})
		string t_meta;
		bool operator==(const SerializedMeta& other)const{
			return guid == other.guid && name == other.name && t_hash == other.t_hash && t_meta == other.t_meta;
		}
	};
	struct ResourceBundle;
	struct MetaBundle
	{
		UPROPERTY({})
		vector<SerializedMeta> metadatas;

		MetaBundle() = default;

		template<typename T>
		const SerializedMeta* FetchMeta() const;
		template<typename T>
		const SerializedMeta* FetchMeta(const string_view& asset_name) const;
		template<typename T>
		void Add(RscHandle<T>);
		bool operator==(const MetaBundle& other)const;
		bool operator!=(const MetaBundle& other)const;
	};
}
#include "meta_bundle.inl"
#include "meta_bundle_gen.inl"