using System;

namespace skyscraper5.Skyscraper.Scraper.Storage.Utilities
{
	public class DatabaseKeyNitTs
	{
		public ushort NetworkId { get; }
		public ushort TransportStreamId { get; }

		public DatabaseKeyNitTs(ushort networkId, ushort transportStreamId)
		{
			NetworkId = networkId;
			TransportStreamId = transportStreamId;
		}

		protected bool Equals(DatabaseKeyNitTs other)
		{
			return NetworkId == other.NetworkId && TransportStreamId == other.TransportStreamId;
		}

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

		public override int GetHashCode()
		{
			return HashCode.Combine(NetworkId, TransportStreamId);
		}
	}
}
