#ifndef FXPARTICLESYSTEMMANAGER_H
#define FXPARTICLESYSTEMMANAGER_H

#include "fxparticlesystem.h"

class CFXParticleSystemManager
{
public:
	// Constructor
	CFXParticleSystemManager();

	// Get particle system from implementation
	CFXParticleSystem *getPSysFromImplementation( std::string strImplementation );

	// Create particle system
	CFXParticleSystem *createParticleSystem( std::string strSystem, cl_entity_t *pEntity = NULL );

	// Create managed particle system
	CFXParticleSystem *createManagedParticleSystem( std::string strSystem, cl_entity_t *pEntity = NULL );

	// Add to list
	CFXParticleSystem *addToList( CFXParticleSystem *pSystem );

	// Remove
	std::list<CFXParticleSystem*>::iterator Remove( std::list<CFXParticleSystem*>::iterator iterRemove );
	void Remove( CFXParticleSystem *pSystem );
	void Remove( int iEntityIndex, std::string strSystem, bool bDieOut=true );
	void Remove( int iEntityIndex, bool bDieOut=true );

	// Reset
	void Reset( void );

	// Think
	void Think( void );

	// Render
	void Render( void );

private:
	std::list<CFXParticleSystem*>	m_ParticleSystems;
};

extern CFXParticleSystemManager g_FXPsysManager;

#endif