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

namespace ECOT.Engine
{
    public class Cursor
    {
        private Sprite sprite;
        private Color color = Color.White;
        private bool applyZoom = false;
        private bool enable = true;

        public bool Enable
        {
            get { return enable; }
            set { enable = value; }
        }
	
        public Cursor()
        {
            this.sprite = new Sprite(@"Bootstrap\Cursors", 0, 0, 32, 32, HotSpotType.TopLeft);
        }

        public Sprite Sprite
        {
            get { return this.sprite; }
            set { this.sprite = value;}
        }

        public Color Color
        {
            get { return this.color; }
            set { this.color = value; }
        }

        public bool ApplyZoom
        {
            get { return this.applyZoom; }
            set { this.applyZoom = value; }
        }

        public void Present()
        {
            Point ms = Kernel.Instance.Input.MousePosition;
            SpriteBatch sp = Kernel.Instance.SpriteBatch;

            sp.Begin(SpriteBlendMode.AlphaBlend);
            
            if (this.Enable)
            {
                float zoom = (this.applyZoom ? Kernel.Instance.Zoom : 1.0f);
                this.sprite.Draw(new Vector2(ms.X, ms.Y), 0.0f, 0.0f, zoom, this.color);
            }
            
            sp.End();
        }
    }
}
