using System;
namespace PhoenixLib.Scheduler
{
///
/// Represents a given moment.
///
public class TimePoint
{
///
/// The hour value of the given moment.
///
public byte Hour { get; private set; }
///
/// The minute value of the given moment.
///
public byte Minute { get; private set; }
///
/// Specifies the hour of the given moment.
///
/// The hour between 0 and 23
/// A reference to the used TimePoint object.
public TimePoint AtHour(byte hour)
{
if (Hour > 23)
{
throw new ArgumentOutOfRangeException(nameof(hour), "Value must be between 0 and 23.");
}
Hour = hour;
return this;
}
///
/// Specifies the minute of the given moment.
///
/// The minute between 0 and 59
/// A reference to the used TimePoint object.
public TimePoint AtMinute(byte minute)
{
if (Minute > 59)
{
throw new ArgumentOutOfRangeException(nameof(minute), "Value must be between 0 and 59");
}
Minute = minute;
return this;
}
}
}