using System;

namespace StreamBuddy.PluginInterface.Features
{
    /// <summary>
    /// Defines a feature that will be accessible to all streams
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class FeatureAttribute : Attribute
    {
        /// <summary>
        /// The name of the feature, must be unique as it's used for enabling/disabling the feature.
        /// </summary>
        public string Name { get; private set; }
        /// <summary>
        /// A short description of what the feature will provide for a stream.
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// A list of dependent features that must exist in the stream for this feature to be useable.
        /// </summary>
        public string[] Dependencies { get; set; }

        /// <summary>
        /// Create a new instance of the <seealso cref="FeatureAttribute"/> class.
        /// </summary>
        /// <param name="Name">The name of the feature</param>
        public FeatureAttribute(string Name)
        {
            this.Name = Name;
        }
    }

    /// <summary>
    /// Holds the functions for enabling and disabling a feature.
    /// 
    /// Note that your feature will have one global instance for all streams.
    /// </summary>
    public interface IFeature
    {
        /// <summary>
        /// Executed when the feature is to be enabled on a stream.
        /// </summary>
        /// <param name="Stream">The stream to enable the feature on.</param>
        void Enable(IStream Stream);
        /// <summary>
        /// Executed when the feature is to be disabled on a stream.
        /// </summary>
        /// <param name="Stream">The stream to disable the feature on.</param>
        void Disable(IStream Stream);
    }
}
