using System;

namespace skyscraper5.Skyscraper.Scraper.Storage.Utilities
{
	public class DatabaseKeyCat
	{
		public int NetworkId { get; }
		public int TransportStreamId { get; }
		public int Pid { get; }

		public DatabaseKeyCat(int networkId, int transportStreamId, int pid)
		{
			NetworkId = networkId;
			TransportStreamId = transportStreamId;
			Pid = pid;
		}

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

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

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