using System;

namespace skyscraper5.Skyscraper.Scraper.Storage.Utilities
{
	public class DatabaseKeyBatTs
	{
		public ushort BouquetId { get; }
		public ushort TransportStreamId { get; }
		public ushort OriginalNetworkId { get; }

		public DatabaseKeyBatTs(ushort bouquetId, ushort transportStreamId, ushort originalNetworkId)
		{
			BouquetId = bouquetId;
			TransportStreamId = transportStreamId;
			OriginalNetworkId = originalNetworkId;
		}

		protected bool Equals(DatabaseKeyBatTs other)
		{
			return BouquetId == other.BouquetId && TransportStreamId == other.TransportStreamId && OriginalNetworkId == other.OriginalNetworkId;
		}

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

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