namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory.Model
{
    internal class ComplianceCoordiante
    {
        public int CurrentNetworkId { get; }
        public int CurrentTransportStreamId { get; }
        public string Compliance { get; }

        public ComplianceCoordiante(int currentNetworkId, int currentTransportStreamId, string compliance)
        {
            CurrentNetworkId = currentNetworkId;
            CurrentTransportStreamId = currentTransportStreamId;
            Compliance = compliance;
        }

        protected bool Equals(ComplianceCoordiante other)
        {
            return CurrentNetworkId == other.CurrentNetworkId && CurrentTransportStreamId == other.CurrentTransportStreamId && Compliance == other.Compliance;
        }

        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((ComplianceCoordiante)obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = CurrentNetworkId;
                hashCode = (hashCode * 397) ^ CurrentTransportStreamId;
                hashCode = (hashCode * 397) ^ (Compliance != null ? Compliance.GetHashCode() : 0);
                return hashCode;
            }
        }
    }
}
