using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ShootingHero.Scene
{
	public class LogoScene : DrawableGameComponent
	{
		Texture2D logoTexture;
		Timer timer;

		public LogoScene ( Game game )
			: base ( game )
		{
			timer = new Timer ( 1500 );
		}

		protected override void LoadContent ()
		{
			logoTexture = Game.Content.Load<Texture2D> ( "System/logo" );
			base.LoadContent ();
		}

		protected override void UnloadContent ()
		{
			Game.Content.Unload ();
			base.UnloadContent ();
		}

		public override void Update ( GameTime gameTime )
		{
			timer.Update ( gameTime );
			if ( timer.CheckTimer )
			{
				( Game.Components [ 0 ] as Transitor ).Transition ( new MenuScene ( Game ) );
				timer.Reset ();
			}
			base.Update ( gameTime );
		}

		public override void Draw ( GameTime gameTime )
		{
			SpriteBatch spriteBatch = ( Game as ShootingHero ).SpriteBatch;
			spriteBatch.Draw ( logoTexture, 
				new Vector2 ( 480 / 2 - logoTexture.Width / 2, 800 / 2 - logoTexture.Height / 2 ),
				Color.White );
			base.Draw ( gameTime );
		}
	}
}