using System;

namespace skyscraper5.Skyscraper.Gps
{
	public class GpsSatellite
	{
		public int Id { get; }
		public char SignalId { get; }
		public double Azimuth { get; }
		public double Elevation { get; }
		public int SignalToNoiseRatio { get; }
		public string System { get; }
		public string TalkerId { get; }

		public GpsSatellite(int id, char signalId, double azimuth, double elevation, int signalToNoiseRatio, string system, string talkerId)
		{
			Id = id;
			SignalId = signalId;
			Azimuth = azimuth;
			Elevation = elevation;
			SignalToNoiseRatio = signalToNoiseRatio;
			System = system;
			TalkerId = talkerId;
		}

		protected bool Equals(GpsSatellite other)
		{
			return Id == other.Id && SignalId == other.SignalId && System == other.System && TalkerId == other.TalkerId;
		}

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

		public override int GetHashCode()
		{
			return HashCode.Combine(Id, SignalId, System, TalkerId);
		}
	}
}
