
///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_Actor_InteractionHandler.h
// Author : Andy Tate
// Date   : 4-Sep-2007
//
// Copyright (C) 2007 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif   // ifdef ASURA_USE_PRAGMA_ONCE

#ifndef __AVP_ACTOR_INTERACTIONHANDLER_H__
#define __AVP_ACTOR_INTERACTIONHANDLER_H__

////////////////////////////////////////////////////////////////////////////////
// Include files...
////////////////////////////////////////////////////////////////////////////////

#include "Network/Asura_Guid.h"

#include "Entity/AVP_Messages.h"

////////////////////////////////////////////////////////////////////////////////
// Forward class declarations...
////////////////////////////////////////////////////////////////////////////////

class AVP_ClientEntity_InteractionTrigger;
class AVP_ClientEntity_Actor;
class AVP_ClientEntity_InteractObject;

////////////////////////////////////////////////////////////////////////////////
// Class declaration...
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Class        : AVP_Actor_InteractionHandler
// Author       : Andy Tate
// Date         : 4-Sep-2007
//
// Description  : Class to handle interaction by actors.
////////////////////////////////////////////////////////////////////////////////

class AVP_Actor_InteractionHandler
{
public:
	// Public functions...
	AVP_Actor_InteractionHandler(AVP_ClientEntity_Actor& xOwner);
	virtual ~AVP_Actor_InteractionHandler();

	virtual void Update();
	virtual bool HandleInteraction(AVP_INTERACTION_TYPES eType, int iKeyType, float fKeyValue) const;

	// Virtual query functions...
	virtual bool IsInteractionAllowed() const;

	// Accessor functions...
	virtual Asura_Guid GetGuidForInteraction( AVP_INTERACTION_TYPES eType ) const { return eType == AVP_INTERACTION_TYPE_DEFAULT ? m_uInteractionGuid : ASURA_GUID_UNREGISTERED; } // Some subclasses may store a different guid with certain interaction types.
	virtual bool	   IsInIdleInteraction() const;
    virtual bool       IsInteracting() const;
// Create console vars
#if defined(ASURA_SUPPORT_COMMAND_CONSOLE)
	static void CreateConsoleVars();
#endif	// defined(ASURA_SUPPORT_COMMAND_CONSOLE)

	static bool IsEntityInteracting(const Asura_Guid uGuid);

protected:
	bool SendInteractMessage(AVP_INTERACTION_TYPES eType, const Asura_Hash_ID uInteractionMoveHash,  const AVP_ClientEntity_InteractObject* pxInteractObject, int iLockInteractType) const;

	AVP_ClientEntity_Actor& m_xOwner;
	Asura_Guid				m_uInteractionGuid;	// The GUID of the entity to be actioned by this actor.
private:
	static bool s_bRenderInteractionPrompt;


};   // End of class 'AVP_Actor_InteractionHandler'.

#endif   // ifndef __AVP_ACTOR_INTERACTIONHANDLER_H__

/// End of file. ///
