// Author : Chris Tolley
// Date   : 8/10/2004
// ParticleSystem.h contains the class declaration for a particle system to use
// with the Survival game

#if !defined(AFX_PARTICLESYSTEM_H__AA45FE09_FBBB_4327_B512_39426063310A__INCLUDED_)
#define AFX_PARTICLESYSTEM_H__AA45FE09_FBBB_4327_B512_39426063310A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>
using std::vector;

// A particle
struct Particle
{
	// The color of this particle
	float Color_[3];

	// The position of this particle
	float Position_[3];

	// The amount of distance that this particle can travel along each axis
	// in a single time unit
	float Direction_[3];

	// The age of this particle
	float Age_;

	// The max age of this particle
	float MaxAge_;
};// End Particle struct

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

	// Destructor
	virtual ~ParticleSystem();
	
	// Updates all the particles stored in this system
	void Update( float elapsedSec );

	// Renders all the particles in this system
	void Render();

	// Adds a particle to this system
	inline void AddParticle( Particle& part ) 
				{ m_vParticles.push_back( part ); };

	// Clears out any particles that may be in the system
	void RemoveAll() { m_vParticles.clear(); };
protected:
	// Stores all the particles
	vector< Particle > m_vParticles;
};

#endif // !defined(AFX_PARTICLESYSTEM_H__AA45FE09_FBBB_4327_B512_39426063310A__INCLUDED_)
