using System;

namespace skyscraper5.Skyscraper.Scraper
{
    class VpsCoordinate
    {
        public ushort ProgramNumber { get; }
        public int Month { get; }
        public int Day { get; }
        public int Hour { get; }
        public int Minute { get; }

        public VpsCoordinate(ushort programNumber, int month, int day, int hour, int minute)
        {
            ProgramNumber = programNumber;
            Month = month;
            Day = day;
            Hour = hour;
            Minute = minute;
        }

        protected bool Equals(VpsCoordinate other)
        {
            return ProgramNumber == other.ProgramNumber && Month == other.Month && Day == other.Day && Hour == other.Hour && Minute == other.Minute;
        }

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

        public override int GetHashCode()
        {
            return HashCode.Combine(ProgramNumber, Month, Day, Hour, Minute);
        }
    }
}
