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

namespace pcd_g1
{
	class TouchStageJumpItemStageObject : ItemStageObject
	{
		string stage;
		int xloc, yloc;
		public TouchStageJumpItemStageObject (int x, int y, Stage stg, string to, int xl = -1, int yl = -1) : base(x, y, stg)
		{
			image = null;
			stage = to;
			xloc = xl;
			yloc = yl;
		}

		bool touched = false;
		public override bool EventProc(EventType type, IStageObject sender, CollideDirection direction)
		{
			if (type == EventType.BeTouched)
			{
				if (!touched)
				{
					touched = true;
					StageManager.RunStage(stage, xloc, yloc);
				}
			}
			return base.EventProc(type, sender, direction);
		}
	}
}
