using System;

namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory.Model
{
    internal class InMemoryRdsText
    {
        public int CurrentNetworkId { get; }
        public int CurrentTransportStreamId { get; }
        public int ProgramNumber { get; }
        public string Text { get; }

        public InMemoryRdsText(int currentNetworkId, int currentTransportStreamId, int programNumber, string text)
        {
            CurrentNetworkId = currentNetworkId;
            CurrentTransportStreamId = currentTransportStreamId;
            ProgramNumber = programNumber;
            Text = text;
        }

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

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

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