using System;

namespace Volpe.Cafe.TechKeys
{
    /// <summary>
    /// Provides a definition for a technology key.
    /// </summary>
    public interface ITechKey
    {
        /// <summary>
        /// Gets or sets whether this instance contains a technology with the specified index.
        /// </summary>
        /// <param name="techIndex">The technology index for which to get or set the state.</param>
        /// <returns>
        /// <c>true</c>, if a technology with the specified index is a subset of this instance;
        /// <c>false</c>, otherwise.
        /// </returns>
        /// <exception cref="IndexOutOfRangeException">
        ///     <paramref name="techIndex"/> is outside of allowed range.
        /// </exception>
        bool this[int techIndex] { get; set; }

        /// <summary>
        /// Gets whether this instance represents an empty technology key.
        /// </summary>
        bool IsEmpty { get; }

        /// <summary>
        /// Determines whether this instance contains a technology with the specified index.
        /// </summary>
        /// <param name="techIndex">The technology index to test.</param>
        /// <returns>
        /// true, if a technology with the specified index is a subset of this instance; false, otherwise.
        /// </returns>
        /// <exception cref="IndexOutOfRangeException">
        ///     <paramref name="techIndex"/> is outside of allowed range.
        /// </exception>
        bool Contains(int techIndex);

        /// <summary>
        /// Determines whether this instance contains the specified key.
        /// </summary>
        /// <param name="key">The key to test.</param>
        /// <returns>
        /// true, if key is a subset of this instance; false, otherwise.
        /// </returns>
        bool Contains(ITechKey key);

    }
}
