Merge branch 'master' into jgrpp
# Conflicts: # src/script/api/script_company.cpp # src/script/api/script_date.cpp # src/script/api/script_date.hpp # src/script/api/script_gamesettings.cpp # src/script/api/script_order.hpp # src/script/api/script_town.cpp # src/script/api/script_window.cpp
This commit is contained in:
@@ -28,12 +28,12 @@
|
||||
return (ScriptDate::Date)_date;
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptDate::GetDayLengthFactor()
|
||||
/* static */ SQInteger ScriptDate::GetDayLengthFactor()
|
||||
{
|
||||
return _settings_game.economy.day_length_factor;
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptDate::GetYear(ScriptDate::Date date)
|
||||
/* static */ SQInteger ScriptDate::GetYear(ScriptDate::Date date)
|
||||
{
|
||||
if (date < 0) return DATE_INVALID;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
return ymd.year;
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptDate::GetMonth(ScriptDate::Date date)
|
||||
/* static */ SQInteger ScriptDate::GetMonth(ScriptDate::Date date)
|
||||
{
|
||||
if (date < 0) return DATE_INVALID;
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
return ymd.month + 1;
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptDate::GetDayOfMonth(ScriptDate::Date date)
|
||||
/* static */ SQInteger ScriptDate::GetDayOfMonth(ScriptDate::Date date)
|
||||
{
|
||||
if (date < 0) return DATE_INVALID;
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
return ymd.day;
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptDate::GetDate(int32 year, int32 month, int32 day_of_month)
|
||||
/* static */ ScriptDate::Date ScriptDate::GetDate(SQInteger year, SQInteger month, SQInteger day_of_month)
|
||||
{
|
||||
if (month < 1 || month > 12) return DATE_INVALID;
|
||||
if (day_of_month < 1 || day_of_month > 31) return DATE_INVALID;
|
||||
@@ -69,7 +69,7 @@
|
||||
return (ScriptDate::Date)::ConvertYMDToDate(year, month - 1, day_of_month);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptDate::GetSystemTime()
|
||||
/* static */ SQInteger ScriptDate::GetSystemTime()
|
||||
{
|
||||
time_t t;
|
||||
time(&t);
|
||||
@@ -81,23 +81,23 @@
|
||||
return _settings_game.game_time.time_in_minutes;
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptDate::GetTicksPerMinute()
|
||||
/* static */ SQInteger ScriptDate::GetTicksPerMinute()
|
||||
{
|
||||
return _settings_game.game_time.ticks_per_minute;
|
||||
}
|
||||
|
||||
/* static */ DateTicksScaled ScriptDate::GetCurrentScaledDateTicks()
|
||||
/* static */ SQInteger ScriptDate::GetCurrentScaledDateTicks()
|
||||
{
|
||||
return _scaled_date_ticks;
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptDate::GetHour(DateTicksScaled ticks)
|
||||
/* static */ SQInteger ScriptDate::GetHour(DateTicksScaled ticks)
|
||||
{
|
||||
Minutes minutes = (ticks / _settings_game.game_time.ticks_per_minute) + _settings_game.game_time.clock_offset;
|
||||
return MINUTES_HOUR(minutes);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptDate::GetMinute(DateTicksScaled ticks)
|
||||
/* static */ SQInteger ScriptDate::GetMinute(DateTicksScaled ticks)
|
||||
{
|
||||
Minutes minutes = (ticks / _settings_game.game_time.ticks_per_minute) + _settings_game.game_time.clock_offset;
|
||||
return MINUTES_MINUTE(minutes);
|
||||
|
Reference in New Issue
Block a user