载入中...
搜索中...
未找到
GrowthCalendar.cpp
浏览该文件的文档.
84 DiagnosticCode::InvalidArgument, "daysPerSeason must be positive", "growth.calendar.daysPerSeason"));
EVEngine assertion entry point, backed by zeroerr.
#define EV_ASSERT(cond,...)
Assert an internal engine invariant (state that must always hold).
Definition Assert.h:37
Stable, structured diagnostics shared by engine modules.
Owning, renderer-independent dynamic values.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Result< Value > fromJson(std::string_view json)
Parse one strict JSON value into an owning Value.
Definition Value.cpp:177
const T * getIf() const noexcept
Return a typed pointer, or nullptr when the kind differs.
Definition Value.h:209
int daysPerSeason() const noexcept
Days of the first season slot (legacy helper).
Definition GrowthCalendar.cpp:91
Result< void > setSeasonLayoutFromJson(std::string_view json)
Parses [{"id":"bloom","days":40},…] and applies setSeasonLayout. @cost Cheap JSON parse of a small ar...
Definition GrowthCalendar.cpp:39
std::string seasonId() const
Current season id string (never empty when layout is valid).
Definition GrowthCalendar.cpp:117
Result< void > setSeasonLayout(std::vector< SeasonSlotDef > seasons) noexcept
Replaces the season layout (must be non-empty; each slot days > 0). @cost Cheap: copies a small seaso...
Definition GrowthCalendar.cpp:23
std::int64_t year() const noexcept
0-based year from dayIndex / yearLength.
Definition GrowthCalendar.cpp:105
Season season() const noexcept
Legacy Season enum when layout is the default 4 Earth seasons; else maps by index%4.
Definition GrowthCalendar.cpp:122
int seasonIndex() const noexcept
Index into seasonLayout() for the current day.
Definition GrowthCalendar.cpp:107
Result< void > setDaysPerSeason(int days) noexcept
Sets every slot's day count (keeps current ids). Positive only.
Definition GrowthCalendar.cpp:81
int seasonCount() const noexcept
Definition GrowthCalendar.cpp:96
static const char * seasonName(Season season) noexcept
Stable English season name for the default Earth layout.
Definition GrowthCalendar.cpp:143
int dayOfSeason() const noexcept
Day within the current season [0, slot.days).
Definition GrowthCalendar.cpp:126
void advanceWholeDays(std::int64_t days) noexcept
Advances the calendar by whole simulation days (truncated toward zero).
Definition GrowthCalendar.cpp:136
Definition Growth.cpp:11
Season
Legacy four-season index kept for Earth-farm defaults and older tests.
Definition GrowthCalendar.h:23
@ Autumn
@ Spring
@ Summer
@ Winter
@ InvalidArgument
One named season slot in a configurable calendar layout.
Definition GrowthCalendar.h:14