//---------------------------------------------------------------------------
// File			: AVP_Behaviour_Civilian_Wander.h
// Created		: 04 / 03 / 2008
// 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_CIVILIAN_WANDER_H__
#define __AVP_BEHAVIOUR_CIVILIAN_WANDER_H__ 1
// END FILE WRAPPER ///////////////////////////////////////////

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

// FORWARD DECLARATIONS ///////////////////////////////////
class AVP_Brain_Actor_Civilian;
class AVP_ServerEntity_GamePlayVolume;

//---------------------------------------------------------------------------
// Class		: AVP_Behaviour_Civilian_Wander
//---------------------------------------------------------------------------
class AVP_Behaviour_Civilian_Wander : public Axon_Project_Behaviour
{
	typedef Axon_Project_Behaviour PARENT;

public:

	// Wander Update State Enum
	enum WanderUpdateState
	{
		UNSET,
		FIND_ACTION,
		MOVE_TO_ACTION,
		WAIT_FOR_COMPLETION,
		MAX_STATES
	};

	// Construction / Deconstruction
	AVP_Behaviour_Civilian_Wander						(AVP_Brain_Actor_Civilian* pxBrain);
	virtual ~AVP_Behaviour_Civilian_Wander				(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

	// Public Member Functions...
	WanderUpdateState				GetUpdateState		(void) const					{return m_eUpdateState;}
	AVP_Brain_Actor_Civilian*		GetCivilianBrain	(void)							{return m_pxCivilianBrain;}

protected:

	void							SetUpdateState			(WanderUpdateState eState)	{m_eUpdateState = eState;}
	void							SwitchToState			(WanderUpdateState eState);
	void							CreateMovementBehaviour	(const Asura_Vector_3& xGoToPoint);


	bool							FindNextGS2Action();

private:

	// Private Member Variables...
	WanderUpdateState				m_eUpdateState;
	AVP_Brain_Actor_Civilian*		m_pxCivilianBrain;
	Asura_Guid						m_uLastActionGuid;
	Asura_Guid						m_uCurrentNode;
	float							m_fFindActionTimer;

	enum { CURRENT_CHUNK_VERSION = 0 };

};

#endif //__AVP_BEHAVIOUR_CIVILIAN_WANDER_H__

/// End Of File 'AVP_Behaviour_Civilian_Wander.h'
