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

namespace pcd_g1
{
	class ChangingEffect : IEffect
	{
		public bool IsSleeping { get { return false; } }

		public bool IsModal { get { return true; } }

		public bool IsVisible { get { return true; } }

		int count = 0;
		public bool Update()
		{
			if (count >= 1280)
			{
				count = 0;
				return true;
			}
			else
			{
				count += 20;
			}
			return false;
		}

		//int boxMax = 64;
		public void Draw(Bitmap inputImage, Graphics input, Graphics output, int inputWidth, int inputHeight, int outputWidth, int outputHeight)
		{
			if (count < 640)
			{
				output.FillRectangle(Brushes.Black, (640 - count) * (outputWidth / inputWidth), 0, outputWidth, outputHeight);
			}
			else if (count == 640)
			{
				output.FillRectangle(Brushes.Black, 0, 0, outputWidth, outputHeight);
			}
			else
			{
				output.DrawImage(inputImage, (1280 - count) * (outputWidth / inputWidth), 0, outputWidth, outputHeight);
			}
		}
	}
}
