using UnityEngine;
using UnityEngine.Events;

namespace MaskShop
{
    /// <summary>
    /// Custom UnityEvent for mask requests
    /// </summary>
    [System.Serializable]
    public class MaskRequestEvent : UnityEvent<MaskRequest> { }

    /// <summary>
    /// Event system for Ogre behavior communication
    /// </summary>
    public static class OgreEvents
    {
        /// <summary>
        /// Invoked when an ogre generates a new mask request
        /// </summary>
        public static event System.Action<MaskRequest> OnMaskRequested;

        /// <summary>
        /// Invoked when an ogre finishes its routine (either satisfied or leaves)
        /// </summary>
        public static event System.Action OnOgreFinished;

        /// <summary>
        /// Invoked when a mask request is completed/fulfilled
        /// </summary>
        public static event System.Action<MaskRequest> OnRequestCompleted;

        public static void RaiseMaskRequested(MaskRequest request)
        {
            OnMaskRequested?.Invoke(request);
        }

        public static void RaiseOgreFinished()
        {
            OnOgreFinished?.Invoke();
        }

        public static void RaiseRequestCompleted(MaskRequest request)
        {
            OnRequestCompleted?.Invoke(request);
        }
    }
}