using HaCreator.MapEditor.Instance.Shapes;
using MapleLib.WzLib.WzStructure.Data;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XNA = Microsoft.Xna.Framework;

namespace HaCreator.MapEditor.Instance.Misc
{
    public abstract class MiscRectangle : MapleRectangle, INamedMisc
    {
        public abstract string Name { get; }

        public MiscRectangle(Board board, XNA.Rectangle rect)
            : base(board, rect)
        {
        }

        public override MapleDot CreateDot(int x, int y)
        {
            return new MiscDot(this, board, x, y);
        }

        public override MapleLine CreateLine(MapleDot a, MapleDot b)
        {
            return new MiscLine(board, a, b);
        }

        public override XNA.Color Color
        {
            get
            {
                return Selected ? UserSettings.ToolTipSelectedFill : UserSettings.ToolTipFill;
            }
        }

        public override ItemTypes Type
        {
            get { return ItemTypes.Misc; }
        }

        public override void Draw(SpriteBatch sprite, XNA.Color dotColor, int xShift, int yShift)
        {
            base.Draw(sprite, dotColor, xShift, yShift);
            board.ParentControl.FontEngine.DrawString(sprite, new System.Drawing.Point(X + xShift + 2, Y + yShift + 2), XNA.Color.Black, Name, Width);
        }

        public MiscRectangle(Board board, MapleRectangle.SerializationForm json)
            : base(board, json) { }
    }
}
