#ifndef PARTICLESYSTEM_H
#define PARTICLESYSTEM_H

//This is a generic particle system. It is not meant to be instantiated.
//By Michael Barnathan.

#include "Particle.h"
#include "ParticleVector.h"
#include <GL/glut.h>
#include <cassert>
#include <cstring>

class ParticleSystem {
protected:
	Particle* particles;	//The particles used by this system.
	unsigned int numparticles;	//The number of particles that exist.
	unsigned int maxparticles;	//The maximum number of particles.

	ParticleVector origin;		//The origin of this system.
	ParticleVector size;			//The size of this system.

	unsigned long lastupdate;	//Time of the last update, in ms.
public:
	ParticleSystem(const unsigned int maxpart);
	ParticleSystem(const ParticleSystem& rhs);

	virtual ParticleSystem& operator=(const ParticleSystem& rhs);
	virtual ~ParticleSystem();

	virtual ParticleVector getOrigin() const;
	virtual void setOrigin(const ParticleVector& neworigin);

	virtual ParticleVector getSize() const;
	virtual void setSize(const ParticleVector& newsize);

	virtual void updateBehavior() = 0;
	virtual void update();

	virtual Particle* emit(unsigned int& numtoemit);
	virtual void reset();
};

#endif

