﻿#pragma warning disable CA1710

namespace Dike.Core.Collections.Generic
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// Extends <see cref="IList{Type}"/> to add restriction a specific base type.
    /// </summary>
    /// <typeparam name="TBaseType">Base Type of <see cref="Type"/>s in this list</typeparam>
    public interface ITypeList<in TBaseType>
         : IList<Type>
    {
        #region Methods

        /// <summary>
        /// Adds a type to the list.
        /// </summary>
        /// <typeparam name="T">Type to add to the list.</typeparam>
        void Add<T>()
            where T : TBaseType;

        /// <summary>
        /// Determines whether a type exists in the list.
        /// </summary>
        /// <typeparam name="T">Type to determine.</typeparam>
        /// <returns><c>true</c> if the list contains the type; otherwise, <c>false</c>.</returns>
        bool Contains<T>()
            where T : TBaseType;

        /// <summary>
        /// Removes a type from the list.
        /// </summary>
        /// <typeparam name="T">The type to remove.</typeparam>
        void Remove<T>()
            where T : TBaseType;

        #endregion Methods
    }
}

#pragma warning restore CA1710