#ifndef _BREAKOUTBOX_H_
#define _BREAKOUTBOX_H_

#include "Vector2.h"
#include "AABB.h"

class BreakoutBox
{
	public:
	BreakoutBox();
	BreakoutBox(const Vector2i &pos, const Vector2i &size, const unsigned int &health);
	~BreakoutBox();

	virtual void Draw();
	virtual void Update() {}

	void SetPosition(const Vector2i &pos)
	{
		m_position = pos;
		updateBBox();
	}

	void SetSize(const Vector2i &size)
	{
		m_size = size;
		updateBBox();
	}

	void SetHealth(const int &health) { m_health = health; }

	void Enable() { m_bIsEnabled = true; }
	bool IsEnabled() { return m_bIsEnabled; }
	void Disable() { m_bIsEnabled = false; }

	Vector2i GetPosition() { return m_position; }
	Vector2i GetSize() { return m_size; }

	AABBi GetAABB() { return m_boundingBox; }

	void TakeHit();
	
	int GetHealth() { return m_health; }

	bool IsAlive() { return m_bIsAlive; }

	protected:
	bool m_bIsEnabled, m_bIsAlive;
	Vector2i m_position, m_size;
	AABBi m_boundingBox;	
	int m_health;
	unsigned long m_lastHitTime;

	void updateBBox();
};

#endif
