using System;

namespace skyscraper5.Skyscraper.Scraper.Storage.Utilities
{
	public class DatabaseKeyTot
	{
		public int CurrentNetworkId { get; }
		public int CurrentTransportStreamId { get; }
		public string OffsetCountryCode { get; }
		public int LocalTimeOffset { get; }
		public bool LocalTimeOffsetPolarity { get; }

		public DatabaseKeyTot(int currentNetworkId, int currentTransportStreamId, string offsetCountryCode, int localTimeOffset, bool localTimeOffsetPolarity)
		{
			CurrentNetworkId = currentNetworkId;
			CurrentTransportStreamId = currentTransportStreamId;
			OffsetCountryCode = offsetCountryCode;
			LocalTimeOffset = localTimeOffset;
			LocalTimeOffsetPolarity = localTimeOffsetPolarity;
		}

		protected bool Equals(DatabaseKeyTot other)
		{
			return CurrentNetworkId == other.CurrentNetworkId && CurrentTransportStreamId == other.CurrentTransportStreamId && OffsetCountryCode == other.OffsetCountryCode && LocalTimeOffset == other.LocalTimeOffset && LocalTimeOffsetPolarity == other.LocalTimeOffsetPolarity;
		}

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

		public override int GetHashCode()
		{
			return HashCode.Combine(CurrentNetworkId, CurrentTransportStreamId, OffsetCountryCode, LocalTimeOffset, LocalTimeOffsetPolarity);
		}
	}
}
