Skip to main content

MonthDayHour

A struct in Root.Township, the global namespace.

A point in the year (month, day, hour) with no year, used for seasonal or dated events. Compares in month, day, hour order.

Constructors​

MemberWhat it is
MonthDayHour(Month month, int day, int hour)Creates a MonthDayHour from month, day and hour.

Fields​

4 private and internal fields
MemberWhat it is
private static MonthDayHour currentUnused static field. The Current property builds a fresh value from UTC now instead.
private int dayDay of the month, 1 to 32 in the inspector.
private int hourHour of the day, 0 to 23.
private Month monthThe month.

Properties​

MemberWhat it is
static MonthDayHour Current { get; }The current UTC month, day and hour.
int Day { get; }Day of the month.
int Hour { get; }Hour of the day, 0 to 23.
Month Month { get; }The month.

Methods​

MemberWhat it is
int CompareTo(MonthDayHour other)Orders by month, then day, then hour.
override bool Equals(object obj)True if month, day and hour match.
bool Equals(MonthDayHour other)True if month, day and hour match.
override int GetHashCode()Hash from month, day and hour.
bool IsBetween(MonthDayHour start, MonthDayHour end)True if strictly after start and before end. Handles ranges that wrap past the year end.
static bool op_Equality(MonthDayHour a, MonthDayHour b)Same month, day and hour.
static bool op_GreaterThan(MonthDayHour a, MonthDayHour b)Later in the year.
static bool op_Inequality(MonthDayHour a, MonthDayHour b)Different month, day or hour.
static bool op_LessThan(MonthDayHour a, MonthDayHour b)Earlier in the year.

Used in​

Members of other types that take, return or hold a MonthDayHour: