#include "Wumbo-Hitbox.h"
#include <cstdio>
namespace Wumbo
{
	Hitbox::Hitbox()
	{
		x = y = left = top = width = height = 0;
	}
	Hitbox::Hitbox(int left, int top, int width, int height)
	{
		x = 0;
		y = 0;
		this->left = left;
		this->top = top;
		this->width = width;
		this->height = height;
	}
	bool Hitbox::hits(Hitbox h)
	{
		if (y+top > h.y+h.top+h.height-1)
			return false;
		if (x+left > h.x+h.left+h.width-1)
			return false;
		if (x+left+width-1 < h.x+h.left)
			return false;
		if (y+top+height-1 < h.y+h.top)
			return false;
		return true;
	}
}