using ZelWiki.Engine.Function;

namespace ZelWiki.Engine.Library.Interfaces
{
    /// <summary>
    /// 处理函数.
    /// </summary>
    public interface IFunctionHandler
    {
        /// <summary>
        /// 回调.
        /// </summary>
        /// <returns></returns>
        public FunctionPrototypeCollection Prototypes { get; }

        /// <summary>
        /// 当匹配到合适的原型时，调用以处理函数调用
        /// </summary>
        /// <param name="state"></param>
        /// <param name="function"></param>
        /// <param name="scopeBody"></param>
        /// <returns></returns>
        public HandlerResult Handle(IZelEngineState state, FunctionCall function, string? scopeBody = null);
    }
}