//	Collidable.h - Base class for all collidable entities in the game.
//  ----------------------------------------------------------------------------
//	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 COLLIDABLE_H_
#define COLLIDABLE_H_

#include "ThreeFloats.h"
#include "TwoFloats.h"

#include <string>

class GamePlayState;

///	Base class for all collidable entities in the game.
class Collidable
{
  public:
	///	Constructor.
	Collidable(const std::wstring& n):
	name(n)
	{
		
	};
	///	Destructor.
	virtual ~Collidable() {};

	///	Returns true if this entity wants to know when it collides with the named entity type.
	virtual bool interestedInCollisionsWith(const std::wstring& entity) const = 0;
	///	Called when this entity collides with another.
	/*!
		\return True if collision effects should be triggered.
	 */
	virtual bool collide(const shared_ptr<Collidable>& other,
						 GamePlayState& state) = 0;

	///	Returns the entity's position.
	virtual const TwoFloats& getPosition() const = 0;
	///	Returns the entity's radius.
	virtual float getRadius() const = 0;
	///	Returns the entity's colour.
	virtual const ThreeFloats& getColour() const = 0;
	///	Returns true if other entities can pass through this one.
	/*!
		If this is true, collide() will only be called for this entity, rather
		than both of the entities involved (i.e. Pickups will be informed that a
		Tank collided with them, but the Tank will not be told that).
	 */
	virtual bool getIncorporeal() const = 0;

	///	Returns the entity's name/type.
	const std::wstring& getName() const {return name;};
  private:
	///	This entity's name/type.
	std::wstring name;
};

#endif
