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
{
    public enum TrapType
    {
        Spike,
        Mudslide
    }

    abstract class BaseTrap
    {
        protected Vector2 location;
        protected List<BoundingBox> buddiAlerts = new List<BoundingBox>();
        public List<BoundingBox> Alerts
        {
            get
            {
                return buddiAlerts;
            }
        }

        protected TrapType type;
        public TrapType Type
        {
            get
            {
                return type;
            }
        }
        public abstract BoundingBox FatalArea
        {
            get;
        }

        public BaseTrap(int x, int y) : this(new Vector2(x,y))
        {

        }

        public BaseTrap(Vector2 loc)
        {
            location = loc;

            CreateBuddiAlerts(loc);
        }

        protected virtual void CreateBuddiAlerts(Vector2 pos)
        {

        }

        public virtual void Update(GameTime gameTime)
        {
        }

        public virtual void Draw(SpriteBatch spriteBatch)
        {
            return;
            spriteBatch.Draw(TextureManager.Textures["onepixel"], new Rectangle((int)FatalArea.Min.X, (int)FatalArea.Min.Y,
                                                            (int)(FatalArea.Max.X - FatalArea.Min.X),
                                                            (int)(FatalArea.Max.Y - FatalArea.Min.Y)), Color.Orange);  // deal with it 8) */

            foreach (BoundingBox bounds in buddiAlerts)
            {
                spriteBatch.Draw(TextureManager.Textures["onepixel"], new Rectangle((int)bounds.Min.X, (int)bounds.Min.Y,
                                                                            (int)(bounds.Max.X - bounds.Min.X),
                                                                            (int)(bounds.Max.Y - bounds.Min.Y)), Color.Green);  // deal with it 8)
            }
        }
    }
}
