//////////////////////////////////////////////////////////////////////////////
//
// AVP_Profile_Controls.h
//
// (AJK - 25.07.2008) Created
//
// Copyright (c) 2008 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

#ifndef __AVP_PROFILE_CONTROL__
#define __AVP_PROFILE_CONTROL__

//Forward declaration
class Asura_Chunk_Stream;

class AVP_Profile_Controls
{

public:

	AVP_Profile_Controls();

#if defined(ASURA_SUPPORT_COMMAND_CONSOLE)
	void SetupConsoleCommands();
	void SetupConsoleVariables();
	void RemoveConsoleVariables();
#endif	//defined(ASURA_SUPPORT_COMMAND_CONSOLE)

	static	u_int GetCurSpeciesControlsMenuHash();

    void	SetToDefaults();

	void	WriteToChunkStream(Asura_Chunk_Stream& xStream);
	void	ReadFromChunkStream(Asura_Chunk_Stream& xStream);

	void	SetAutoCenter( bool bCenter )		{ m_bAutoCenter = bCenter;			}
	void	SetInvertY( bool bInvert )			{ m_bInvertY = bInvert;				}
	void	SetInvertX( bool bInvert )			{ m_bInvertX = bInvert;				}
	void	SetVibrate( bool bVibe )			{ m_bVibrations = bVibe;			}
	void	SetLeftHandControl( bool bLHCont )	{ m_bLeftHandControl = bLHCont;		}
	void	SetSimpleMovement( bool bSimpMove )	{ m_bSimpleMovement = bSimpMove;	}
	void	SetSensitivityX( float fSens )		{ m_fXAxisSensitivity = fSens;		}
	void	SetSensitivityY( float fSens )		{ m_fYAxisSensitivity = fSens;		}
	void	SetLog2SensitivityX( float fSens )	{ m_fLog2XAxisSensitivity = fSens;	}
	void	SetLog2SensitivityY( float fSens )	{ m_fLog2YAxisSensitivity = fSens;	}
	void	SetAimAssist( bool bAimAssist )		{ m_bAimAssist = bAimAssist;		}
	void	SetLookAssist( bool bLookAssist )	{ m_bLookAssist = bLookAssist;		}	

	bool	GetAutoCenter()				const	{ return m_bAutoCenter;				}
	bool	GetInvertY()				const	{ return m_bInvertY;				}
	bool	GetInvertX()				const	{ return m_bInvertX;				}	
	bool	GetVibrate()				const	{ return m_bVibrations;				}
	bool	GetLeftHandControl()		const	{ return m_bLeftHandControl;		}
	bool	GetSimpleMovement()			const	{ return m_bSimpleMovement ;		}
	float	GetSensitivityX()			const	{ return m_fXAxisSensitivity;		}
	float	GetSensitivityY()			const	{ return m_fYAxisSensitivity;		}
	float	GetLog2SensitivityX()		const	{ return m_fLog2XAxisSensitivity;	}
	float	GetLog2SensitivityY()		const	{ return m_fLog2YAxisSensitivity;	}
	bool	GetAimAssist()				const	{ return m_bAimAssist;				}
	bool	GetLookAssist()				const	{ return m_bLookAssist;				}

	bool	operator==( const AVP_Profile_Controls& xOther ) const;
	bool	operator!=( const AVP_Profile_Controls& xOther ) const;

    void	Update();

	void ApplySettings();

private:

	enum 
	{
		CURRENT_CHUNK_VERSION = 1,
	};

	static const u_int s_uAVP_PROFILE_ALIEN_CONTROLS_MENU    = 0xF590912E; //Asura_GetHashID( "Alien_Controls");
	static const u_int s_uAVP_PROFILE_MARINE_CONTROLS_MENU   = 0x74844493; //Asura_GetHashID( "Marine_Controls");
	static const u_int s_uAVP_PROFILE_PREDATOR_CONTROLS_MENU = 0x83165AFE; //Asura_GetHashID( "Predator_Controls"); 

    static float ApproxLog2( const float fX );

	bool	m_bInvertX;
	bool	m_bInvertY;
	bool	m_bVibrations;
	bool	m_bLeftHandControl;
	bool	m_bSimpleMovement;
	bool	m_bAutoCenter;
	bool	m_bAimAssist;
	bool	m_bLookAssist;

	float	m_fXAxisSensitivity;
	float	m_fYAxisSensitivity;
	float	m_fLog2XAxisSensitivity;
	float	m_fLog2YAxisSensitivity;
};



#endif // #ifndef __AVP_PROFILE_CONTROL__
