#pragma once
#include <Exam_HelperStructs.h>

namespace BT
{
	enum class State;
}

class Blackboard;

namespace BT_Grid {
	BT::State UpdateExplorationGrid(Blackboard* blackboardPtr);

	BT::State FindUnexploredCell(Blackboard* blackboardPtr);
}

namespace BT_Action
{
	BT::State SetTimer(Blackboard* blackboardPtr, const std::string& timerName, bool doOnce);
	BT::State UnlockTimer(Blackboard* blackboardPtr, const std::string& timerName);
	BT::State LockTimer(Blackboard* blackboardPtr, const std::string& timerName);

	BT::State GoToTarget(Blackboard* blackboardPtr);
	BT::State EnableSpin(Blackboard* blackboardPtr);
	BT::State DisableSpin(Blackboard* blackboardPtr);

	BT::State FindClosestEdge(Blackboard* blackboardPtr, int degree);

	BT::State SetZombieTarget(Blackboard* blackboardPtr);
	BT::State AvoidingZombie(Blackboard* blackboardPtr);
	BT::State RotateToZombie(Blackboard* blackboardPtr);
	BT::State ReadyToShoot(Blackboard* blackboardPtr, float minAngleDiff);
	BT::State Shoot(Blackboard* blackboardPtr, eItemType type);

	BT::State UseItem(Blackboard* blackboardPtr, eItemType type);

	BT::State SetItemAsTarget(Blackboard* blackboardPtr);
	BT::State DestroyItemOnFloor(Blackboard* blackboardPtr);
	BT::State PickUpItem(Blackboard* blackboardPtr);
	BT::State SwapItem(Blackboard* blackboardPtr);
	BT::State CheckItem(Blackboard* blackboardPtr);

	BT::State TryFindHouse(Blackboard* blackboardPtr, float searchRadius, int degree);
	BT::State FindRandomLocation(Blackboard* blackboardPtr, float randomRadius);
	BT::State GetHouseAsTarget(Blackboard* blackboardPtr, float maxTravelDistance);
	BT::State CheckHouses(Blackboard* blackboardPtr);
	BT::State SetExpireDate(Blackboard* blackboardPtr);
	BT::State GetInsideTarget(Blackboard* blackboardPtr, float offset);


}

namespace BT_Condition
{
	bool CheckTimerLock(Blackboard* blackboardPtr, const std::string& timerName);
	bool CheckTimer(Blackboard* blackboardPtr, const std::string& timerName, bool doOnce);

	bool InPurgeZone(Blackboard* blackboardPtr);

	bool SeeZombie(Blackboard* blackboardPtr);
	bool HasWeapon(Blackboard* blackboardPtr);
	bool InRange(Blackboard* blackboardPtr, float maxRange);

	bool ItemInInv(Blackboard* blackboardPtr, eItemType type);
	bool HpUnderThreshold(Blackboard* blackboardPtr, float threshold);
	bool CheckMinNeededEnergy(Blackboard* blackboardPtr);

	bool SeeItem(Blackboard* blackboardPtr);
	bool IsTypeOfItem(Blackboard* blackboardPtr, eItemType type);
	bool InvIsNotFull(Blackboard* blackboardPtr);
	bool EmptyValue(Blackboard* blackboardPtr);
	bool InvIsFull(Blackboard* blackboardPtr);

	bool InsideTargetHouse(Blackboard* blackboardPtr);
	bool SeeHouse(Blackboard* blackboardPtr);
	bool NewHouse(Blackboard* blackboardPtr);
	bool ReExploreHouse(Blackboard* blackboardPtr);

	bool CheckMovement(Blackboard* blackboardPtr, float timeout);

}

