#ifndef cparticlesystem_h
#define cparticlesystem_h

#include "ForwardDeclarations.h"
#include "cParticle.h"
#include "cSplashParticle.h"
#include "cSmokeRingParticle.h"
#include "cHoleArrowParticle.h"
#include "cTextureImage.h"
#include "cBoundingBox.h"
#include "cBoundingBox.h"
#include "cStaticTriangleMesh.h"
#include "cSmokeTextParticle.h"
#include "cSnowParticle.h"

#include <math.h>
#include <vector>
#include <list>

class cParticleSystem
{
public:
    int level_;
    
    
    cVector cloudCenter_;
    float cloudRadius_;
    

    list<cSplashParticle*> splashes_; 
    list<cSmokeRingParticle*> smokeRings_;
    list<cHoleArrowParticle*> holeArrows_;    
    list<cSmokeTextParticle*> smokeText_;    
    list<cSnowParticle*> snow_;


    cTextureImage dropletImage_;
    cTextureImage cloudPuffImage_;
    cTextureImage holeArrowImage_;
    cTextureImage smileyImage_;
    
    float age_;
    
    // a box the contains all of the traingles that particles could interact with
    cBoundingBox box_;	
    
    cParticleSystem();
    ~cParticleSystem();
    
    void clearNonText(); // destroy all non text particles
    
    void setLevel(int level);
    
    void update(float dt);
    
    void draw();
    
    
    void addSmiley();	// adds a smoke smiley
    void killText(); 	// tell text too die soon
    void addSmokeRing(cVector origin);
    void addSmokeText(cTextureImage& image, float centerX, float centerY);		// adds new smoke particle
	

    cSplashParticle* addSplash();
    cSmokeRingParticle* addSmokeRingParticle();
    cHoleArrowParticle* addHoleArrow();
    cSmokeTextParticle* addSmokeTextParticle();
    cSnowParticle* addSnowParticle();

    list<cSplashParticle*>::iterator removeSplash(list<cSplashParticle*>::iterator& i);
    list<cSmokeRingParticle*>::iterator removeSmokeRingParticle(list<cSmokeRingParticle*>::iterator& i);
    list<cSmokeTextParticle*>::iterator removeSmokeTextParticle(list<cSmokeTextParticle*>::iterator& i);
	list<cSnowParticle*>::iterator removeSnowParticle(list<cSnowParticle*>::iterator& i);
    
};

#endif