//////////////////////////////////////////////////////////////////////////////
//
// AVP_Cutscene_Event_SetVisionMode.h
//
// (Ali Jakamy - 25.05.2008) Created
//
// Copyright (c) 2008 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

#include "Cutscene/Asura_Cutscene_Event.h"

class AVP_Cutscene_Event_SetVisionMode : public Asura_Cutscene_Event
{
	friend class ToolsAVP_Cutscene_Event_SetVisionMode;

public :

	AVP_Cutscene_Event_SetVisionMode(Asura_Cutscene* pxCutscene);
	virtual void Trigger(Asura_Cutscene* pxCutscene);
	virtual void UpdateAfterTrigger(Asura_Cutscene* pxCutscene);
	virtual void Finish();

#ifdef ASURA_TOOLS
	virtual void AddExtraFilesToList( List<Asura_String>& xNameList ) const;
	virtual void Copy(Asura_Cutscene_Event* pxEvent);
#endif

	//Load/save functions , defined in Asura_Chunk_Cutscene.cpp
	virtual int  GetChunkSize();
	virtual void SaveToChunk(char*& pcChunkBuffer);
	virtual void LoadFromChunk(Asura_Chunk_CutsceneEvent* pxChunk, Asura_Handle iFileHandle);

	// Setters
	void SetVisionModeHash( Asura_Hash_ID uVisionModeHash) { m_uVisionModeHash = uVisionModeHash; }
	void SetDuration( float fDuration) { m_fDuration = fDuration; }
	void SetFlags(u_int uFlags) { m_uFlags = uFlags; }

private :
 
	enum 
	{
		FLAG_IMMEDIATE_TRANSITION_AT_START  = 0x00000001,
		FLAG_IMMEDIATE_TRANSITION_AT_END    = 0x00000002,
        FLAG_VISION_MODE_SET                = 0x00000004,
	};
    
	enum 
	{
		CURRENT_CHUNK_VERSION = 0,
	};

    void SetVisionMode();
	void UnsetVisionMode();

	Asura_Hash_ID m_uVisionModeHash;			// event data
	float         m_fDuration;					// Duration of the event
	u_int         m_uFlags;						// immediate or transitional event, triggered vision mode?
    Asura_Hash_ID m_uOriginalVisionModeHash; 	// Backup for old vision mode to restore on event finish

    typedef Asura_Cutscene_Event PARENT;

};