
#ifndef FXPARTICLE_H
#define FXPARTICLE_H

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

	// Reset
	virtual void Reset();
	
	// Think : return if particle is alive/dead
	virtual bool Think( const float &flTimeDelta );

	// Calculate Life
	virtual void calculateLife( const float &flTimeDelta );

	// Calculate Velocity
	virtual void calculateVelocity( const float &flTimeDelta );

	// Calculate Collision
	virtual void calculateCollision( const float &flTimeDelta );

	// Calculate Size
	virtual void calculateSize( void );

	// Calculate Color
	virtual void calculateColor( void );

	// Get Percent Life
	virtual float getPercentLife( void );

	// Is dead
	virtual bool isDead( void );

	// Linked list ptrs
	CFXParticle	*m_pPrev;
	CFXParticle	*m_pNext;

	/*
	* Accessors
	*/
	vec3_t getOrigin( void ) { return m_vecOrigin; }
	void setOrigin( vec3_t vecOrigin ) { m_vecOrigin = vecOrigin; }

	vec3_t getPrevOrigin( void ) { return m_vecPrevOrigin; }
	void setPrevOrigin( vec3_t vecOrigin ) { m_vecPrevOrigin = vecOrigin; }

	vec3_t getVelocity( void ) { return m_vecVelocity; }
	void setVelocity( vec3_t vecVelocity ) { m_vecVelocity = vecVelocity; }

	HSPRITE getSprite( void ) { return m_hsprSprite; }
	void setSprite( HSPRITE hsprSprite ) { m_hsprSprite = hsprSprite; }

	float getGravity( void ) { return m_flGravity; }
	void setGravity( float flGravity ) { m_flGravity = flGravity; }

	float getBounceDampen( void ) { return m_flBounceDamp; }
	void setBounceDampen( float flDamp ) { m_flBounceDamp = flDamp; }

	float getAirResistance( void ) { return m_flAirResistance; }
	void setAirResistance( float flResistance ) { m_flAirResistance = flResistance; }

	float *getStartRGBA( void ) { return m_flStartRGBA; }
	float *getEndRGBA( void ) { return m_flEndRGBA; }
	float *getRGBA( void ) { return m_flRGBA; }

	float getStartSize( void ) { return m_flStartSize; }
	void setStartSize( float flSize ) { m_flStartSize = flSize; }

	float getEndSize( void ) { return m_flEndSize; }
	void setEndSize( float flSize ) { m_flEndSize = flSize; }

	float getSize( void ) { return m_flSize; }
	void setSize( float flSize ) { m_flSize = flSize; }

	float getStartLife( void ) { return m_flStartLife; }
	void setStartLife( float flLife ) { m_flStartLife = flLife; }

	float getCurrentLife( void ) { return m_flCurrentLife; }
	void setCurrentLife( float flLife ) { m_flCurrentLife = flLife; }

	int getCollision( void ) { return m_iCollision; }
	void setCollision( int iCollision ) { m_iCollision = iCollision; }

	int getBounceCount( void ) { return m_iBounceCount; }
	void setBounceCount( int iCount ) { m_iBounceCount = iCount; }
	void incBounceCount( void ) { ++m_iBounceCount; }

	bool isSleeping( void ) { return m_bSleepVel; }
	void setSleep( bool bSleep ) { m_bSleepVel = bSleep; }
protected:
	vec3_t		m_vecOrigin;
	vec3_t		m_vecPrevOrigin;
	vec3_t		m_vecVelocity;
	HSPRITE		m_hsprSprite;
	float		m_flGravity;
	float		m_flBounceDamp;
	float		m_flAirResistance;
	float		m_flStartRGBA[4];
	float		m_flEndRGBA[4];
	float		m_flRGBA[4];
	float		m_flStartSize;
	float		m_flEndSize;
	float		m_flSize;
	float		m_flStartLife;
	float		m_flCurrentLife;
	int			m_iCollision;
	int			m_iBounceCount;
	bool		m_bSleepVel;
};
#endif