Farm growth module facade (eve.Growth): species registry + world step.
更多...
#include <Growth.h>
Public 成员函数 | |
| Module_REG (Growth) | |
| Growth ()=default | |
| ~Growth () override=default | |
| Result< int > | registerSpeciesFromJson (const std::string &json) |
| Registers species from a JSON object or array. | |
| void | clearSpecies () |
| Clears species (tests / demos). | |
| bool | hasSpecies (const std::string &id) const |
| int | speciesCount () const |
| Result< void > | setDaysPerSeason (int days) |
| Result< void > | setSeasonLayoutFromJson (const std::string &json) |
| Configures a custom season layout from JSON (alien year cycles). @cost Cheap: parses a small season table. | |
| Result< void > | setSecondsPerSimDay (double seconds) |
| void | setRngSeed (std::uint64_t seed) |
| Result< void > | advanceDays (double days) |
| Result< void > | stepSeconds (double seconds) |
| std::int64_t | dayIndex () const |
| std::int64_t | year () const |
| std::string | seasonName () const |
| Result< Organism * > | spawn (const std::string &speciesId) |
| Spawns any registered species (plant, animal, or custom lifeform). | |
| Result< Organism * > | plant (const std::string &speciesId) |
| Convenience: spawn when species.kindId == "plant". | |
| Result< Organism * > | spawnAnimal (const std::string &speciesId) |
| Convenience: spawn when species.kindId == "animal". | |
| Result< void > | tryBreed (Organism *carrier, Organism *partner) |
| Result< void > | tryReproduce (Organism *organism) |
| Solo reproduction for self_bud / fission / spore_burst species. | |
| void | clearEvents () |
| int | eventCount () const |
| std::string | eventKind (int index) const |
| std::uint64_t | eventOrganismId (int index) const |
| std::string | eventSpeciesId (int index) const |
| std::string | eventDetail (int index) const |
| void | resetWorld () |
| Resets calendar, events, and species for demos/tests. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| Module. | |
| virtual std::string | getName () const =0 |
| Returns the name. | |
详细描述
构造及析构函数说明
◆ Growth()
|
default |
◆ ~Growth()
|
overridedefault |
成员函数说明
◆ advanceDays()
| Result< void > eve::growth::Growth::advanceDays | ( | double | days | ) |
在文件 Growth.cpp 第 35 行定义.
引用了 eve::growth::GrowthWorld::advanceDays() , 以及 eve::growth::GrowthWorld::instance().
◆ clearEvents()
| void eve::growth::Growth::clearEvents | ( | ) |
◆ clearSpecies()
| void eve::growth::Growth::clearSpecies | ( | ) |
◆ dayIndex()
| std::int64_t eve::growth::Growth::dayIndex | ( | ) | const |
◆ eventCount()
| int eve::growth::Growth::eventCount | ( | ) | const |
◆ eventDetail()
| std::string eve::growth::Growth::eventDetail | ( | int | index | ) | const |
◆ eventKind()
| std::string eve::growth::Growth::eventKind | ( | int | index | ) | const |
◆ eventOrganismId()
| std::uint64_t eve::growth::Growth::eventOrganismId | ( | int | index | ) | const |
◆ eventSpeciesId()
| std::string eve::growth::Growth::eventSpeciesId | ( | int | index | ) | const |
◆ hasSpecies()
| bool eve::growth::Growth::hasSpecies | ( | const std::string & | id | ) | const |
在文件 Growth.cpp 第 19 行定义.
◆ Module_REG()
| eve::growth::Growth::Module_REG | ( | Growth | ) |
◆ plant()
Convenience: spawn when species.kindId == "plant".
在文件 Growth.cpp 第 58 行定义.
引用了 created, eve::growth::Organism::createOrganism(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::growth::Organism::release().
◆ registerSpeciesFromJson()
| Result< int > eve::growth::Growth::registerSpeciesFromJson | ( | const std::string & | json | ) |
Registers species from a JSON object or array.
在文件 Growth.cpp 第 15 行定义.
◆ resetWorld()
| void eve::growth::Growth::resetWorld | ( | ) |
Resets calendar, events, and species for demos/tests.
在文件 Growth.cpp 第 123 行定义.
引用了 eve::growth::SpeciesRegistry::clear() , 以及 eve::growth::GrowthWorld::resetInstance().
◆ seasonName()
| std::string eve::growth::Growth::seasonName | ( | ) | const |
◆ setDaysPerSeason()
| Result< void > eve::growth::Growth::setDaysPerSeason | ( | int | days | ) |
◆ setRngSeed()
| void eve::growth::Growth::setRngSeed | ( | std::uint64_t | seed | ) |
在文件 Growth.cpp 第 33 行定义.
引用了 eve::growth::GrowthWorld::instance(), seed , 以及 eve::growth::GrowthWorld::setRngSeed().
◆ setSeasonLayoutFromJson()
| Result< void > eve::growth::Growth::setSeasonLayoutFromJson | ( | const std::string & | json | ) |
Configures a custom season layout from JSON (alien year cycles). @cost Cheap: parses a small season table.
在文件 Growth.cpp 第 25 行定义.
引用了 eve::growth::GrowthWorld::calendar(), eve::growth::GrowthWorld::instance() , 以及 eve::growth::GrowthCalendar::setSeasonLayoutFromJson().
◆ setSecondsPerSimDay()
| Result< void > eve::growth::Growth::setSecondsPerSimDay | ( | double | seconds | ) |
在文件 Growth.cpp 第 29 行定义.
引用了 eve::growth::GrowthWorld::instance() , 以及 eve::growth::GrowthWorld::setSecondsPerSimDay().
◆ spawn()
Spawns any registered species (plant, animal, or custom lifeform).
在文件 Growth.cpp 第 56 行定义.
◆ spawnAnimal()
Convenience: spawn when species.kindId == "animal".
在文件 Growth.cpp 第 70 行定义.
引用了 created, eve::growth::Organism::createOrganism(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument , 以及 eve::growth::Organism::release().
◆ speciesCount()
| int eve::growth::Growth::speciesCount | ( | ) | const |
在文件 Growth.cpp 第 21 行定义.
◆ stepSeconds()
| Result< void > eve::growth::Growth::stepSeconds | ( | double | seconds | ) |
在文件 Growth.cpp 第 37 行定义.
引用了 eve::SimulationStep::delta, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Duration::fromSeconds(), eve::growth::GrowthWorld::instance(), eve::InvalidArgument, eve::growth::GrowthWorld::step(), step , 以及 eve::detail::StrongUint64< detail::SimulationTickTag >::zero().
◆ tryBreed()
◆ tryReproduce()
Solo reproduction for self_bud / fission / spore_burst species.
在文件 Growth.cpp 第 90 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::growth::GrowthWorld::instance(), eve::InvalidArgument , 以及 eve::growth::GrowthWorld::tryReproduce().
◆ year()
| std::int64_t eve::growth::Growth::year | ( | ) | const |
该类的文档由以下文件生成:
- src/modules/growth/Growth.h
- src/modules/growth/Growth.cpp
Public 成员函数 继承自