Owner of calendar, RNG seed, and the sole simulation advance path. 更多...
#include <GrowthSystem.h>
Public 成员函数 | |
| GrowthWorld ()=default | |
| Result< void > | setSecondsPerSimDay (double seconds) noexcept |
| Seconds of SimulationStep.delta that equal one simulation day. | |
| double | secondsPerSimDay () const noexcept |
| void | setRngSeed (std::uint64_t seed) noexcept |
| Deterministic seed for disease / yield hash streams. | |
| std::uint64_t | rngSeed () const noexcept |
| GrowthCalendar & | calendar () noexcept |
| const GrowthCalendar & | calendar () const noexcept |
| GrowthEventLog & | events () noexcept |
| const GrowthEventLog & | events () const noexcept |
| Result< void > | step (const SimulationStep &step) |
| Converts a fixed SimulationStep into fractional sim days and advances. @cost Linear in live organism count for the fractional day span. | |
| Result< void > | advanceDays (double days) |
| Advances every live organism by simulation days (may be fractional). @cost Linear in organism count × whole-day crossings for calendar events. | |
| Result< void > | tryBreed (Organism &carrier, Organism &partner) |
| Starts pair_gestation on carrier when both partners satisfy the species rules. @cost Cheap validation + component write; offspring spawn on later advance. | |
| Result< void > | tryReproduce (Organism &organism) |
| Triggers a solo reproduction pulse for self_bud / fission / spore_burst. | |
| void | resetForTests () |
| Clears organisms' world-facing bookkeeping used by tests (events + calendar). | |
静态 Public 成员函数 | |
| static GrowthWorld & | instance () |
| Process-wide world used by Organism helpers and the Growth module. | |
| static void | resetInstance () |
| Replaces process instance with a fresh world (tests). | |
友元 | |
| class | Organism |
详细描述
Owner of calendar, RNG seed, and the sole simulation advance path.
Callers inject SimulationStep (or explicit sim days). Wall clock is never read.
在文件 GrowthSystem.h 第 19 行定义.
构造及析构函数说明
◆ GrowthWorld()
|
default |
成员函数说明
◆ advanceDays()
| Result< void > eve::growth::GrowthWorld::advanceDays | ( | double | days | ) |
Advances every live organism by simulation days (may be fractional). @cost Linear in organism count × whole-day crossings for calendar events.
在文件 GrowthSystem.cpp 第 104 行定义.
引用了 eve::growth::GrowthCalendar::advanceWholeDays(), eve::growth::GrowthCalendar::dayIndex(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::growth::Organism::isDead(), eve::growth::Organism::liveOrganisms() , 以及 eve::Result< T >::success().
被这些函数引用 eve::growth::Growth::advanceDays() , 以及 step().
◆ calendar() [1/2]
|
inlinenoexcept |
在文件 GrowthSystem.h 第 32 行定义.
◆ calendar() [2/2]
|
inlinenoexcept |
◆ events() [1/2]
|
inlinenoexcept |
在文件 GrowthSystem.h 第 34 行定义.
◆ events() [2/2]
|
inlinenoexcept |
◆ instance()
|
static |
Process-wide world used by Organism helpers and the Growth module.
在文件 GrowthSystem.cpp 第 60 行定义.
被这些函数引用 eve::growth::Growth::advanceDays(), eve::growth::Growth::clearEvents(), eve::growth::Growth::dayIndex(), eve::growth::Growth::eventCount(), eve::growth::Growth::eventDetail(), eve::growth::Growth::eventKind(), eve::growth::Growth::eventOrganismId(), eve::growth::Growth::eventSpeciesId(), eve::growth::Organism::harvest(), eve::growth::Organism::refillNeed(), eve::growth::Growth::seasonName(), eve::growth::Growth::setDaysPerSeason(), eve::growth::Growth::setRngSeed(), eve::growth::Growth::setSeasonLayoutFromJson(), eve::growth::Growth::setSecondsPerSimDay(), eve::growth::Growth::stepSeconds(), eve::growth::Growth::tryBreed(), eve::growth::Growth::tryReproduce() , 以及 eve::growth::Growth::year().
◆ resetForTests()
| void eve::growth::GrowthWorld::resetForTests | ( | ) |
Clears organisms' world-facing bookkeeping used by tests (events + calendar).
在文件 GrowthSystem.cpp 第 89 行定义.
引用了 eve::growth::GrowthEventLog::clear() , 以及 eve::growth::GrowthCalendar::reset().
◆ resetInstance()
|
static |
Replaces process instance with a fresh world (tests).
在文件 GrowthSystem.cpp 第 62 行定义.
引用了 eve::growth::Organism::liveOrganisms().
被这些函数引用 eve::growth::Growth::resetWorld().
◆ rngSeed()
|
inlinenoexcept |
在文件 GrowthSystem.h 第 29 行定义.
◆ secondsPerSimDay()
|
inlinenoexcept |
在文件 GrowthSystem.h 第 25 行定义.
◆ setRngSeed()
|
inlinenoexcept |
Deterministic seed for disease / yield hash streams.
在文件 GrowthSystem.h 第 28 行定义.
引用了 seed.
被这些函数引用 eve::growth::Growth::setRngSeed().
◆ setSecondsPerSimDay()
|
noexcept |
Seconds of SimulationStep.delta that equal one simulation day.
在文件 GrowthSystem.cpp 第 70 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::Result< T >::success().
◆ step()
| Result< void > eve::growth::GrowthWorld::step | ( | const SimulationStep & | step | ) |
Converts a fixed SimulationStep into fractional sim days and advances. @cost Linear in live organism count for the fractional day span.
在文件 GrowthSystem.cpp 第 95 行定义.
引用了 advanceDays(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 step.
被这些函数引用 eve::growth::Growth::stepSeconds().
◆ tryBreed()
Starts pair_gestation on carrier when both partners satisfy the species rules. @cost Cheap validation + component write; offspring spawn on later advance.
在文件 GrowthSystem.cpp 第 318 行定义.
引用了 eve::growth::Bred, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::growth::SpeciesRegistry::find(), eve::growth::ReproductionDef::gestationDays, eve::InvalidArgument, eve::growth::Organism::isDead(), eve::growth::Organism::isMature(), eve::growth::Organism::isPregnant(), eve::growth::ReproductionDef::mode, eve::NotFound, eve::growth::PairGestation, eve::growth::ReproductionDef::partnerMustSameSpecies, eve::PreconditionViolation, eve::growth::SpeciesDef::reproduction, eve::growth::ReproductionDef::requiresPartner, eve::growth::Organism::speciesId(), eve::growth::Organism::stableId() , 以及 eve::Result< T >::success().
被这些函数引用 eve::growth::Growth::tryBreed().
◆ tryReproduce()
Triggers a solo reproduction pulse for self_bud / fission / spore_burst.
- 备注
- Interval modes also fire automatically from advanceDays; this forces one attempt. @cost Cheap validation; may spawn organisms immediately.
在文件 GrowthSystem.cpp 第 363 行定义.
引用了 eve::growth::Bred, count, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::growth::SpeciesRegistry::find(), eve::growth::Fission, eve::InvalidArgument, eve::growth::Organism::isDead(), eve::growth::Organism::isMature(), eve::growth::SpeciesDef::kindId, eve::growth::ReproductionDef::mode, eve::NotFound, eve::growth::ReproductionDef::offspringCountMax, eve::growth::ReproductionDef::offspringCountMin, eve::PreconditionViolation, eve::growth::SpeciesDef::reproduction, eve::growth::SelfBud, eve::growth::Organism::speciesId() , 以及 eve::growth::SporeBurst.
被这些函数引用 eve::growth::Growth::tryReproduce().
友元及相关函数文档
◆ Organism
|
friend |
在文件 GrowthSystem.h 第 70 行定义.
该类的文档由以下文件生成:
- src/modules/growth/GrowthSystem.h
- src/modules/growth/GrowthSystem.cpp