
///////////////////////////////////////////////////////////////////////////////
//
// File   : Asura_ControlMapping_HoldKey.h
// Author : Andy Tate
// Date   : 5-Dec-2005
//
// Copyright (C) 2005 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

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

#ifndef __ASURA_CONTROLMAPPING_HOLDKEY_H__
#define __ASURA_CONTROLMAPPING_HOLDKEY_H__

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

#include "Input/Asura_ControlMapping.h"


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


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

class Asura_ControlMapping_HoldKey : public Asura_ControlMapping
{
public:
	// Public enumerated type...
	enum RampType
	{
		NO_RAMPING,
		LINEAR_RAMPING,
		KEY_SCALED_LINEAR_RAMPING,

		MAX_RAMP_TYPES
	};


	// Public functions...

	Asura_ControlMapping_HoldKey		  (const int iKeyID, const float fMinDuration, const float fScale, const RampType eRampType = NO_RAMPING, const KeyHoldType eHoldType = ON_PRESS);
//	virtual ~Asura_ControlMapping_HoldKey ();

	// Overridden virtual functions...
	virtual void	ResetValue(void);
	virtual	void	UpdateValues(const bool bActive, float& fValue, float& fHUDValue);
	virtual int		GetControlID(void) const	{ return m_iKeyID; } 

	virtual Asura_Hash_ID	GetInstanceMappingType(void) const	{ return s_uMappingType; } 
	static	Asura_Hash_ID	GetClassMappingType( void )			{ return s_uMappingType; }

protected:
	// Protected variables...


	// Protected functions...


private:
	// Private variables...
	static const Asura_Hash_ID s_uMappingType = 0x4112FD40;	//Asura_GetHashId( "HOLDKEY" )

	// The key AND the type of hold to check-for...
	int			m_iKeyID;
	float		m_fMinDuration;
	float		m_fValueToReport;
	KeyHoldType	m_eHoldType;
	RampType	m_eRampType;

	// The values to be stored...
	float	m_fCurrentDuration;


	// Private functions...

	Asura_ControlMapping_HoldKey  (void);
	Asura_ControlMapping_HoldKey  (const Asura_ControlMapping_HoldKey& xOther);

			Asura_ControlMapping_HoldKey&	operator=	(const Asura_ControlMapping_HoldKey& xOther);

};   // End of class 'Asura_ControlMapping_HoldKey'.


#endif   // ifndef __ASURA_CONTROLMAPPING_HOLDKEY_H__


/// End of file. ///
