using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Penguin {
	public class AABB {
		public float x;
		public float y;
		public float ex;
		public float ey;
		public float minx;
		public float miny;
		public float maxx;
		public float maxy;

		// hack for Stars
		public bool pickedUp = false;

		public AABB(float _x, float _y, float _ex, float _ey) {
			Set(_x, _y, _ex, _ey);
		}

		public bool PointInside(float _x, float _y) {
			return _x >= x - ex && _x <= x + ex && _y >= y - ey && _y <= y + ey;
		}

		public void Set(float _x, float _y, float _ex, float _ey) {
			x = _x;
			y = _y;
			ex = _ex;
			ey = _ey;
			minx = x - ex;
			miny = y - ey;
			maxx = x + ex;
			maxy = y + ey;
		}
	}
}
