#pragma once
#include <vector>
#include <Utils/Random.h>

#include "../Assets/Townsfolk.h"
#include "../Assets/Constants.h"
#include "../Assets/Animation.h"
#include "../Animator.h"
#include "Human.h"
#include "Soldier.h"
#include "Artisan.h"
#include "Map.h"

namespace mechanics {
	class Townsfolk : public Human {
	public:
		Townsfolk(Animator &base, Animator &hair, Animator &cloth, Gender::Type given_gender);

		virtual void locateTo(const gge::utils::Point &given_location);

		unsigned lastSocialCheck() const;

		void lastSocialCheck(unsigned value);

		virtual void setAnimation(Direction direction, std::string animationID, bool isLooping = true, float speed = 1);

		virtual void setDirection(Direction direction, std::string animationID);

		virtual void checkAction();

		virtual float movementSpeed() const {
			return Human::movementSpeed()*0.5;
		}

		void DecideStats();

		virtual void Killed(Attacker *attacker, BaseWeapon *weapon);

		Soldier *BecomeASoldier();
		Artisan *BecomeAnArtisan(const std::string &type);

		Animator &animatorCloth;

	private:
		unsigned mLastSocialCheck;
		unsigned mNextAction;
	};
}
