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

namespace pcd_g1
{
	class FreeStage : ScrollableStage
	{
		public static string FileName;
		public HPWidghet HPWidghet { get; private set; }

		public FreeStage() : base()
		{
			//Characterの配置
			MainCharacter = new MainCharacterStageObject(32, 32, this);

			int w, h;
			foreach (var item in ReadStgFile.ReadStageFile(FileName, out w, out h, this))
			{
				Add(item);
			}
			ScrollRangeX = w * 32;
			ScrollRangeY = h * 32;

			Add(MainCharacter);

			//HPゲージ
			HPWidghet = new HPWidghet((MainCharacterStageObject)MainCharacter);
			MainForm.form.Widghets.Add(HPWidghet);
		}

		public override void Draw(Graphics g, int width, int height)
		{
			//背景画像の描画
			g.FillRectangle(Brushes.Black, 0, 0, width, height);

			base.Draw(g, width, height);
		}
	}
}
