using System;

namespace skyscraper5.Skyscraper.Gps
{
	public class SatelliteBeam
	{
		public int Id { get; }
		public float Position { get; }
		public string Name { get; }
		public DateTime ProcessTimestamp { get; }

		public SatelliteBeam(int id, float position, string name, DateTime processTimestamp)
		{
			Id = id;
			Position = position;
			Name = name;
			ProcessTimestamp = processTimestamp;
		}

		protected bool Equals(SatelliteBeam other)
		{
			return Id == other.Id && ProcessTimestamp.Equals(other.ProcessTimestamp);
		}

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

		public override int GetHashCode()
		{
			return HashCode.Combine(Id, ProcessTimestamp);
		}

		public override string ToString()
		{
			return $"{nameof(Position)}: {Position}, {nameof(Name)}: {Name}";
		}
	}
}
