/**
* Timeline Manager
* @version: 01-29-2005
* @author Joseph 'Pcjoe' Florencio
*/
#ifndef FXTIMELINEMANAGER_H
#define FXTIMELINEMANAGER_H

class CTimelineManager
{
public:
	// Constructor & Destructor
	CTimelineManager();
	~CTimelineManager();
	
	// Update Data
	void updateData( void );

	// Add Timeline
	void addTimeline( CTimeline *pTime );

	// Get timeline by ID
	CTimeline *getTimeline( int iID );

	// HACK HACK: Reset Triggers
	void resetTriggers( float flReleaseAfterTime );

	// Read XML
	virtual void readXML( TiXmlElement *pElement );

	// Write XML
	virtual TiXmlElement *writeXML( void );

	// Calculate Time Delta
	float getTimeDelta( void ) { return getTime()-getPrevTime(); }

	// Accessors
	void setFXObject( CFXObject *pObj ) { m_pFXObject = pObj; }
	CFXObject *getFXObject( void ) { return m_pFXObject; }

	void setTime( float flTime ) { m_flTime = flTime; }
	float getTime( void ) { return m_flTime; }

	void setPrevTime( float flTime ) { m_flPrevTime = flTime; }
	float getPrevTime( void ) { return m_flPrevTime; }

	std::list<CTimeline*> *getTimeLines( void ) { return &m_Timelines; }

private:
	CFXObject	*m_pFXObject;
	std::list<CTimeline*>	m_Timelines;
	float		m_flTime;
	float		m_flPrevTime;
};

#endif