#pragma once
#include <Engine/Animation.h>
#include <Resource/Folder.h>
#include <map>
#include <string>
#include <Utils/Point2D.h>
#include <Engine/Graphics.h>
#include "../Basic.h"

namespace assets
{
	class Animation
	{
	public:
		Animation();
		gge::resource::Animation *directions[4];
	};

	class AnimationProvider
	{
	public:
		AnimationProvider() {}
		void load(gge::resource::Folder &folder);
		static AnimationProvider &loadNew(gge::resource::Folder &folder)
		{
			AnimationProvider &anim = *new AnimationProvider;
			anim.load(folder);
			return anim;
		}

		static void RecolorAll();

		AnimationProvider &Recolor(std::string newid, gge::graphics::RGBint firstcolor, gge::graphics::RGBint secondcolor=0xff000000);

		std::string ID;
		gge::utils::Point attachmentPoint;
		ObjectType type;
		gge::graphics::RGBint baseColor;
		gge::graphics::RGBint secondColor;
		std::map<std::string, Animation*> animations;

		static std::map<std::string, AnimationProvider*> list;
	};
}
