namespace eNavigator.Models
{
  public interface ISelectable<T>
  {
    public bool Equals(ISelectable<T> item);
    public int GetHashCode();
    public String ToString();
    public int GetIndex();
  }

  public class Selectable<T> : ISelectable<T>
  {
    public int Index { get; set; }

    public String Name { get; set; }

    public bool Equals(ISelectable<T> item)
    {
      return item.GetIndex().Equals(GetIndex());
    }

    public override int GetHashCode() => Index.GetHashCode();    

    public int GetIndex() 
    { 
      return Index;
    }

    public override String ToString()
    {
      return Name;
    }
  }
}