namespace Assets.src.rpg
{
	public class CObject
	{
		public const sbyte FRIENDLY = 1;

		public const sbyte UNFRIENDLY = -1;

		public const sbyte NEUTRAL = 0;

		public static int z0 = 100;

		public static int xView;

		public static int yView;

		public int x;

		public int y;

		public int z;

		public int w;

		public int h;

		public int vx;

		public int vy;

		public static int vmax = 196;

		public bool sleep;

		public bool deleted;

		private int dx;

		private int dy;

		public CObject()
		{
		}

		public CObject(int x, int y, int w, int h)
		{
			set(x, y, w, h);
		}

		public void set(int x, int y, int w, int h)
		{
			this.x = x;
			this.y = y;
			this.w = w;
			this.h = h;
		}

		public void setPos(int x, int y)
		{
			this.x = x;
			this.y = y;
		}

		public void setSize(int w, int h)
		{
			this.w = w;
			this.h = h;
		}

		public void move()
		{
			dx += vx;
			x += dx >> 10;
			dx &= 1023;
			dy += vy;
			y += dy >> 10;
			dy &= 1023;
		}

		public bool collidesWith(CObject obj)
		{
			return x + w > obj.x && x < obj.x + obj.w && y + h > obj.y && y < obj.y + obj.h;
		}

		public bool collidesWith(int x1, int y1, int w1, int h1)
		{
			return x + w > x1 && x < x1 + w1 && y + h > y1 && y < y1 + h1;
		}

		public bool collidesWith(int x1, int y1)
		{
			return x + w > x1 && x < x1 && y + h > y1 && y < y1;
		}

		public void process()
		{
		}

		public virtual void paint(mGraphics g)
		{
		}
	}
}
