using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace LD20_Game
{
    class EndingScene : BaseScene
    {
        bool sceneOver = false;
        public bool SceneFinished { get { return sceneOver; } }

        private TimeSpan timeOver = TimeSpan.MinValue;
        public EndingScene() { }

        public override void InitalizeScene()
        {

        }

        public override void UpdateScene(Microsoft.Xna.Framework.GameTime gameTime)
        {
            MusicManager.StopAllMusic();

            if (timeOver == TimeSpan.MinValue)
                timeOver = gameTime.TotalGameTime + TimeSpan.FromSeconds(6);

            if ((timeOver < gameTime.TotalGameTime) && sceneOver == false)
            {
                sceneOver = true;
                SceneManager.TransitionTo(new TitleScene());
            }

            base.UpdateScene(gameTime);
        }

        public override void DrawScene(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.GameTime gameTime)
        {
            spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend);
            spriteBatch.Draw(TextureManager.Textures["ending"], Vector2.Zero, Color.White);
            spriteBatch.End();
        }
    }


}
