///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_Behaviour_AlienQueen_Stalk.h
// Author : David Wooldridge
// Date   : 18/11/2008
//
// Copyright (C) 2008 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __AVP_BEHAVIOUR_ALIENQUEEN_STALK_H__
#define __AVP_BEHAVIOUR_ALIENQUEEN_STALK_H__ 1

// axon
#include "Behaviour/Axon_Project_Behaviour.h"

// F O R W A R D   D E C L A R A T I O N S ///////////////////////////////////

class AVP_Brain_Actor_AlienQueen;


class AVP_Behaviour_AlienQueen_Stalk : public Axon_Project_Behaviour
{

	typedef Axon_Project_Behaviour PARENT;
public:

	AVP_Behaviour_AlienQueen_Stalk( AVP_Brain_Actor_AlienQueen* pxBrain );

protected:
	virtual void Deactivate();
	virtual void PerFrameUpdate( const float fTimeslice );

#ifndef ASURA_NO_DEBUG_OUTPUT
	virtual void RenderDebugInfo();
#endif

private:

	enum State
	{
		WAIT,
		FOLLOW_TARGET,
		TARGET_OUT_OF_REACH,
		ATTACKING,
	};

private:

	void SwitchToState( const State eNextState );
	bool ShouldLaunchAttack();
	bool HasRouteToTargetForCharge(const Asura_Vector_3& xOrigin, const Asura_Vector_3& xTarget);
	bool IsTargetOnLedge(const Asura_Vector_3& xOrigin, const Asura_Vector_3& xTarget) const;
	
	AVP_Brain_Actor_AlienQueen* GetAlienQueenBrain() const;

	Asura_Vector_3 m_xLastUpdatePosition;

	State m_eCurrentState;
	float m_fTimeInState;
	float m_fLastChargeRouteCheckTimer;
	float m_fTimeSinceLastAcidSpitAttack;
	bool m_bIsCenterValid;

};

#endif