#ifndef __AIMOVEHPP__
#define __AIMOVEHPP__

class AIMove;

#include <stack>
#include <utils\utils.h>
#include "map.hpp"
#include "move.hpp"
#include "ai.hpp"
#include "ai formation.hpp"

class AIMove {
	friend class AIFormation;

private:
	CPoint curdes;
	bool newdes;
	AI *m_Parent;
	std::stack<PATHELEMENT> m_CurPath;
	std::stack<PATHELEMENT> m_CellPath;

	bool m_InFormation;

//	bool CalcPath (int depth,bool followshort);		// depth = -1 means search until solution
//	float GetOneCost (int sx,int sy,int dx,int dy);		// only to adjecent squares
//	float PathCostGuess (int sx,int sy,int dx,int dy);
	bool SetFormationDes (int x,int y);

public:
	AIMove (AI *parent);
	~AIMove (void);

	virtual CommandEntry *Think (double value,CommandEntry *lastcom);  // if need to remove then this func will delete
	void SetDestination (int x,int y);
	bool JoinFormation (AIFormation& formation);
	AI *Parent (void) const { return m_Parent; }

	void PathReady (std::stack<PATHELEMENT>& dest);
};

#endif