Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes

This commit is contained in:
Tyler Trahan
2023-08-16 09:43:31 -04:00
parent fca2b37726
commit 77173a6a10
66 changed files with 400 additions and 393 deletions

View File

@@ -56,7 +56,7 @@
{
if (month < 1 || month > 12) return DATE_INVALID;
if (day_of_month < 1 || day_of_month > 31) return DATE_INVALID;
if (year < 0 || year > MAX_YEAR) return DATE_INVALID;
if (year < 0 || year > CalendarTime::MAX_YEAR) return DATE_INVALID;
return (ScriptDate::Date)(int32_t)::TimerGameCalendar::ConvertYMDToDate(year, month - 1, day_of_month);
}

View File

@@ -11,6 +11,7 @@
#define SCRIPT_DATE_HPP
#include "script_object.hpp"
#include "timer/timer_game_calendar.h"
#include "../../date_type.h"
/**
@@ -31,7 +32,7 @@ public:
* compose valid date values for a known year, month and day.
*/
enum Date {
DATE_INVALID = (int32_t)::INVALID_DATE, ///< A value representing an invalid date.
DATE_INVALID = (int32_t)::CalendarTime::INVALID_DATE, ///< A value representing an invalid date.
};
/**