using System.Runtime.InteropServices;
using Decal.Interop.Controls;
using Decal.Interop.Inject;
using CmdDestroy = Decal.Interop.Inject.ICommandEvents_DestroyEventHandler;
using CmdHit = Decal.Interop.Inject.ICommandEvents_HitEventHandler;
using CmdUnhit = Decal.Interop.Inject.ICommandEvents_UnhitEventHandler;
using CmdAccepted = Decal.Interop.Inject.ICommandEvents_AcceptedEventHandler;
using CmdCanceled = Decal.Interop.Inject.ICommandEvents_CanceledEventHandler;

namespace Decal.DecalControls
{
    [ComVisible(true)]
    [Guid("3035299A-C5FB-4CC7-A63C-66400B80DCA4")]
    [ClassInterface(ClassInterfaceType.None)]
    [ComSourceInterfaces("Decal.Interop.Inject.ICommandEvents\0\0")]
    [ProgId("DecalControls.DerethMap")]
    public class DerethMapImpl : ControlBase, IDerethMap
    {
        public event CmdDestroy Destroy;
        public event CmdHit Hit;
        public event CmdUnhit Unhit;
        public event CmdAccepted Accepted;
        public event CmdCanceled Canceled;

        protected override void OnDestroy() => Destroy?.Invoke(ID);
    }
}
