#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include <map>
namespace engineapi
{
	using std::string;
	using std::vector;
	using std::map;
	class Asset {
	public:
		friend class AssetManager;
		enum :uint32_t {
			ASSET_NONE_FLAG = 0,
			ASSET_SHARED_FLAG  = 1 << 0,
			ASSET_COPY_FLAG    = 1 << 1,
			ASSET_ASYNC_FLAG   = 1 << 2,
			ASSET_LOADING_FLAG = 1 << 3,
			ASSET_LOADED_FLAG  = 1 << 4,
			ASSET_ANIM_FLAG    = 1 << 5,
		};
	protected:
		uint32_t mFlags;
		string mName;
	public:
		Asset(string name, uint32_t flags):mName(name),mFlags(flags) {};
		~Asset();
		virtual void BeginLoad() {
			mFlags |= ASSET_LOADING_FLAG;
		};
		virtual void EndLoad() {
			mFlags &= ~ASSET_LOADING_FLAG;
			mFlags |= ASSET_LOADED_FLAG;
		};         
		string& GetName() {
			return mName;
		}
	public:
		inline bool IsShared() {
			return mFlags & ASSET_SHARED_FLAG;
		}
		inline bool IsCopyed() {
			return mFlags & ASSET_COPY_FLAG;
		}
		inline bool IsAsync() {
			return mFlags & ASSET_ASYNC_FLAG;
		}
	};
}