using System;

namespace skyscraper5.Skyscraper.Scraper.Storage.Utilities
{
    public class DatabaseKeyPmtEntry
    {
        public int CurrentNetworkId { get; }
        public int CurrentTransportStreamId { get; }
        public ushort ProgramNumber { get; }

        public DatabaseKeyPmtEntry(int currentNetworkId, int currentTransportStreamId, ushort programNumber)
        {
            CurrentNetworkId = currentNetworkId;
            CurrentTransportStreamId = currentTransportStreamId;
            ProgramNumber = programNumber;
        }

        protected bool Equals(DatabaseKeyPmtEntry other)
        {
            return CurrentNetworkId == other.CurrentNetworkId && CurrentTransportStreamId == other.CurrentTransportStreamId && ProgramNumber == other.ProgramNumber;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((DatabaseKeyPmtEntry)obj);
        }

        public override int GetHashCode()
        {
            return HashCode.Combine(CurrentNetworkId, CurrentTransportStreamId, ProgramNumber);
        }
    }
}
