//---------------------------------------------------------------------------
// File			: AVP_Behaviour_Marine_Attack_StandGround.h
// Created		: 
// Created By	: Gareth Thomas
// Copyright (C) 2007 Rebellion. All Rights Reserved.
//---------------------------------------------------------------------------

// BEGIN FILE WRAPPER ///////////////////////////////////////
#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif
#ifndef __AVP_BEHAVIOUR_MARINE_ATTACK_STANDGROUND_H__
#define __AVP_BEHAVIOUR_MARINE_ATTACK_STANDGROUND_H__ 1
// END FILE WRAPPER ///////////////////////////////////////////

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

#include "Core/BrainTypes/AVP_Brain_Actor_Marine.h"

// FORWARD DECLARATIONS ///////////////////////////////////
class AVP_Tactical_System;
class AVP_Knowledge_System_Actor;
class AVP_ServerActor_Human;

//---------------------------------------------------------------------------
// Class		: AVP_Behaviour_Marine_Attack_StandGround
// Description	: 
//---------------------------------------------------------------------------
class AVP_Behaviour_Marine_Attack_StandGround : public Axon_Project_Behaviour
{
	typedef Axon_Project_Behaviour PARENT;

public:

	// InCover Update State Enum
	enum UpdateState
	{
		UNSET,
		STAND_GROUND_CHOOSE,
		STAND_GROUND_MOVE,
		MAX_STATES
	};

	// Construction / Deconstruction
	AVP_Behaviour_Marine_Attack_StandGround( AVP_Brain_Actor_Marine* pxBrain );
	virtual ~AVP_Behaviour_Marine_Attack_StandGround( void );

	// Public Member Virtual Functions...
	virtual bool 					Activate( void );
	virtual void 					Deactivate( void );
	virtual void					PerFrameUpdate( const float fTimeslice );
	#ifndef ASURA_NO_DEBUG_OUTPUT
	virtual void					RenderDebugInfo( void );
	#endif

protected:

	// Public Member Data Access...
	UpdateState						GetUpdateState( void ) const			{ return m_eUpdateState; }
	AVP_Brain_Actor_Marine*			GetMarineBrain( void )					{ return m_pxMarineBrain; }
	AVP_Tactical_System*			GetTacticalSystem( void )				{ return m_pxMarineBrain->GetTacticalSystem(); }
	AVP_Knowledge_System_Actor*		GetKnowledgeSystem( void )				{ return m_pxMarineBrain->GetKnowledgeSystem(); }
	AVP_ServerActor_Human*			GetOurActor( void )						{ return m_pxMarineBrain->GetHumanActor(); }
	void							SetUpdateState( UpdateState eState )	{ m_eUpdateState = eState; }

	// Public Member Functions...
	void							SwitchToState( UpdateState eState );
	bool							FindBestWaypoint( AVP_Navigation::PosEvalFunctor* pxPosEval );
	bool							DoesWaypointContainCoverAndItsNotOccupied( u_int uWaypointID );
	void							CheckForCover();
	void							LookInThreatsArea( const float fTimeslice );

	static u_int					EvaluationFunction( AVP_Navigation::AVP_PosEvalParams xPosEvalParams );

private:

	// Private Member Variables...
	AVP_Brain_Actor_Marine*			m_pxMarineBrain;
	UpdateState						m_eUpdateState;
	float							m_fTimer;
	float							m_fAimTimer;

	enum { CURRENT_CHUNK_VERSION = 1 };
};

#endif //__AVP_BEHAVIOUR_MARINE_ATTACK_STANDGROUND_H__

/// End Of File 'AVP_Behaviour_Marine_Attack_StandGround.h'
