#pragma once
#include "Unit.h"
#include "Player.h"

#define BEHAVIOR_MELEE 1
#define BEHAVIOR_RANGE	2

class Bot : public Unit
{
public:
	std::vector<Player*>* _targets;
	Unit* _target;
	int _selectedAttack;
	int _decisiontime;
public:
	void Decide(std::vector<PRect*>* rects);
	void DecideMelee(std::vector<PRect*>* rects);
	void DecideRange(std::vector<PRect*>* rects);

	bool MoveIntoGameRect(std::vector<PRect*>* rects);
	void UpdateCalldown(float dt);

	virtual void UpdateMove(std::vector<PRect*>* rects, bool direction = false);

	bool sortByDistance(std::pair<AttackProp*, int> a, std::pair<AttackProp*, int> b);
	cocos2d::Vec2 getVectorForProperty(AttackProp* prop);

	Bot(void);
	Bot(UnitTemplate* u, cocos2d::Vec2 position, unsigned team, cocos2d::Node* parent, std::vector<Player*>* targets);
	~Bot(void);
};

