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

namespace LD20_Game
{
    class ExitDoor
    {
        const float Shrinkage = 10.0f;
        Vector2 location;

        public BoundingBox Bounds
        {
            get
            {
                return new BoundingBox( new Vector3(location + new Vector2(Shrinkage), 0), 
                                                new Vector3(location.X + TextureManager.Textures["exitdoor"].Width - Shrinkage,
                                                            location.Y + TextureManager.Textures["exitdoor"].Height - Shrinkage, 0));
            }
        }
        public ExitDoor(int x, int y)
        {
            location = new Vector2(x, y);
        }

        public ExitDoor(Vector2 loc)
        {
            location = loc;
        }

        public void DrawDoor(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(TextureManager.Textures["exitdoor"], location, Color.White);
        }

        public void DrawSign(SpriteBatch spriteBatch)
        {
            int offSet = (TextureManager.Textures["exitdoor"].Width - TextureManager.Textures["exitsign"].Width) / 2;
            Rectangle drawAt = new Rectangle((int)(location.X + offSet), (int)(location.Y - TextureManager.Textures["exitsign"].Height),
                                    TextureManager.Textures["exitsign"].Width, TextureManager.Textures["exitsign"].Height);

            spriteBatch.Draw(TextureManager.Textures["exitsign"], drawAt, Color.White);
        }

    }
}
