#ifndef cparticlesystem_h
#define cparticlesystem_h

#include "ForwardDeclarations.h"
#include "cParticle.h"
#include "cRaindrop.h"
#include "cSplashParticle.h"
#include "cCloudParticle.h"
#include "cSmokeRingParticle.h"
#include "cFireflyParticle.h"
#include "cTextureImage.h"
#include "cBoundingBox.h"
#include "cBoundingBox.h"
#include "cStaticTriangleMesh.h"

#include <vector>
#include <list>

class cParticleSystem
{
public:
    
    cVector cloudCenter_;
    float cloudRadius_;
    
    list<cRaindrop*> raindrops_;
    list<cSplashParticle*> splashes_; 
    list<cCloudParticle*> clouds_;
    list<cFireflyParticle*> fireflies_;
    list<cSmokeRingParticle*> smokeRings_;
    
    cTextureImage dropletImage_;
    cTextureImage cloudPuffImage_;
    cTextureImage fireflyImage_;
    
    cStaticTriangleMesh* objects_;
    
    float age_;
    
    // a box the contains all of the traingles that particles could interact with
    cBoundingBox box_;	
    
    cParticleSystem(cStaticTriangleMesh* objects);
    ~cParticleSystem();
    
    void update(float dt);
    
    void draw();
    
    void addSmokeRing(cVector origin);
    
    cRaindrop* addRaindrop();
    cSplashParticle* addSplash();
    cCloudParticle* addCloud();
    cFireflyParticle* addFirefly();
    cSmokeRingParticle* addSmokeRingParticle();
    
    list<cRaindrop*>::iterator removeRaindrop(list<cRaindrop*>::iterator& i);
    list<cSplashParticle*>::iterator removeSplash(list<cSplashParticle*>::iterator& i);
    list<cCloudParticle*>::iterator removeCloud(list<cCloudParticle*>::iterator& i);
    list<cSmokeRingParticle*>::iterator removeSmokeRingParticle(list<cSmokeRingParticle*>::iterator& i);
    
};

#endif