#pragma once
#include <Resource/DataArray.h>
#include <string>
#include <vector>
#include "../Utils.h"
#include <map>
#include "Animation.h"

namespace assets
{
	class Item
	{
	public:
		Item() {}
		void load(gge::resource::DataArray &dataArray);
		static Item &loadNew(gge::resource::DataArray &dataArray)
		{
			Item &item = *new Item;
			item.load(dataArray);
			return item;
		}

		static std::map<std::string, Item*> list;

		enum Slot
		{
			HeadArmor,
			BodyArmor,
			MainHand,
			OffHand,

			Max
		};

		enum Type
		{
			Armor,
			Melee,
			Ranged,
			Thrust,
			Passive,
			Cast
		};

		std::string ID;
		Type type;
		Slot slot;
		std::vector<std::string> requiredBuilding;
		std::string artisan;
		AnimationProvider *animation;
		float XPReward;
		float cost;
		float craftTime;
		float craftTimeSpeModifier;
		float craftTimeLvlModifier;
		float staminaCost;
		float damage;
		float damageStrModifier;
		float damageDexModifier;
		float damageLvlModifier;
		float range;
		float rangeStrModifier;
		float CD;
		float CDSpeModifier;
		float CDLvlModifier;
		float precision;
		float precisionAccModifier;
		float precisionLvlModifier;
		float parry;
		float parryAccModifier;
		float parryIntlModifier;
		float parryLvlModifier;
		float block;
		float blockAccModifier;
		float blockLvlModifier;
		float armorPierce;
		float armorPierceAccModifier;
		float armorPierceLvlModifier;
		float crit;
		float critAccModifier;
		float critLvlModifier;
		float armor;
		float accModifier;
		float speModifier;
		float CDModifier;
		float movementSpeed;
		float movementSpeedStrModifier;
		float stagger;
		float staggerStrModifier;
		float staggerLvlModifier;
		float staggerReduction;
		float overshootRange;
		float overshootRangeStrModifier;
		float overshootRangeLvlModifier;
		float minOvershootRange;
		float arrowSpeed;
		float arrowSpeedStrModifier;
		float arrowSpeedCap;
		float staminaDrain;
		float sight;
	};
}