//	ShockwaveEntity.h - Represents a collidable shockwave.
//  ----------------------------------------------------------------------------
//	This file is part of 'NiallsAVLib', base code for any kind of audiovisual
//	apps.
//	Copyright (C) 2012  Niall Moody
//	
//	This program is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program.  If not, see <http://www.gnu.org/licenses/>.
//	----------------------------------------------------------------------------

#ifndef SHOCKWAVEENTITY_H_
#define SHOCKWAVEENTITY_H_

#include "ThreeFloats.h"
#include "c0xHeaders.h"
#include "Collidable.h"

class Drawer;

///	Represents a collidable shockwave.
class ShockwaveEntity : public Collidable
{
  public:
	///	Constructor.
	ShockwaveEntity(const TwoFloats& pos, const ThreeFloats& col);
	///	Destructor.
	~ShockwaveEntity();

	///	Scales the ShockwaveEntity.
	/*
		\return If true, the ShockwaveEntity has finished and should be deleted.
	 */
	bool update();
	///	Draws the ShockwaveEntity.
	void draw(shared_ptr<Drawer>& d, float timestepInterp);

	///	Returns the ShockwaveEntity's colour.
	const ThreeFloats& getColour() const {return colour;};

	///	Returns true if this entity wants to know when it collides with the named entity type.
	bool interestedInCollisionsWith(const std::wstring& entity) const;
	///	Called when this entity collides with another.
	bool collide(const shared_ptr<Collidable>& other, GamePlayState& state);

	///	Returns the entity's position.
	const TwoFloats& getPosition() const {return position;};
	///	Returns the entity's radius.
	float getRadius() const {return (index * 64.0f);};
	///	Returns true if other entities can pass through this one.
	bool getIncorporeal() const {return (index < 0.66f);};
  private:
	///	The ShockwaveEntity's position.
	TwoFloats position;
	///	The ShockwaveEntity's colour.
	ThreeFloats colour;
	///	How far the ShockwaveEntity has gone (0->1).
	float index;
};

#endif
