Growth short-root entity for any configured lifeform. 更多...
#include <Organism.h>
类 | |
| struct | Growth |
| Species binding and stage progress. 更多... | |
| struct | Health |
| Disease state; empty diseaseId means healthy. 更多... | |
| struct | Produce |
| Periodic produce timer (milk, crystals, spores as yield — not offspring). 更多... | |
| struct | Reproduction |
| Reproduction progress for any authored mode. 更多... | |
| struct | VitalNeeds |
| Named need meters in permille [0, 1000], keyed by species need id. 更多... | |
Public 成员函数 | |
| void | release () override |
| const std::string & | speciesId () |
| const std::string & | kindId () |
| OrganismKind | kind () |
| int | stageIndex () |
| std::string | stageId () |
| double | stageProgressDays () |
| bool | isMature () |
| bool | isDead () |
| bool | isHarvested () |
| bool | isDiseased () |
| bool | isPregnant () |
| std::string | diseaseId () |
| double | waterPermille () |
| Convenience meters when the species declares water/food/fertility needs. | |
| double | foodPermille () |
| double | fertilityPermille () |
| double | needPermille (const std::string &needId) |
| Generic meter read; missing need returns 0. | |
| Result< void > | refillNeed (const std::string &needId, double permille) |
| Refills a named need declared by the species. @cost Cheap: O(1) meter write + optional event. | |
| Result< void > | waterBy (double permille) |
Adds water when the species declares a water need. @cost Cheap: O(1) meter write + optional event. | |
| Result< void > | feed (double permille) |
Adds food when the species declares a food need. @cost Cheap: O(1) meter write + optional event. | |
| Result< void > | fertilize (double permille) |
Adds fertility when the species declares a fertility need. @cost Cheap: O(1) meter write + optional event. | |
| Result< std::vector< YieldReceipt > > | harvest () |
| Harvests once when mature and harvestYield is non-empty (any lifeform). @cost Moderate: copies yield defs and marks harvested; emits one event. | |
| std::uint64_t | stableId () const noexcept |
| Stable ECS id for event correlation. | |
| void | destroy () |
| Script destroy entry (aliases release). | |
静态 Public 成员函数 | |
| static Result< Organism * > | createOrganism (const std::string &speciesId) |
| Creates an organism bound to a registered species. | |
| static const std::vector< Organism * > & | liveOrganisms () |
| Live organisms currently visible to Growth views. | |
详细描述
Growth short-root entity for any configured lifeform.
Orthogonal state lives in components. Scene / hex / inventory links are owned by adapters outside this module (spatial binding 2A).
在文件 Organism.h 第 29 行定义.
成员函数说明
◆ createOrganism()
Creates an organism bound to a registered species.
- 参数
-
speciesId Must already be registered.
- 返回
- Borrowed ECS entity; caller releases via release()/destroy.
在文件 Organism.cpp 第 25 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::growth::SpeciesRegistry::find(), eve::growth::SpeciesDef::id, eve::growth::SpeciesDef::kind, eve::growth::SpeciesDef::kindId, eve::growth::SpeciesDef::needs, eve::NotFound, speciesId() , 以及 eve::Result< T >::success().
被这些函数引用 eve::growth::Growth::plant(), eve::growth::Growth::spawn() , 以及 eve::growth::Growth::spawnAnimal().
◆ destroy()
| void eve::growth::Organism::destroy | ( | ) |
◆ diseaseId()
| std::string eve::growth::Organism::diseaseId | ( | ) |
在文件 Organism.cpp 第 88 行定义.
◆ feed()
| Result< void > eve::growth::Organism::feed | ( | double | permille | ) |
Adds food when the species declares a food need. @cost Cheap: O(1) meter write + optional event.
在文件 Organism.cpp 第 133 行定义.
引用了 refillNeed().
◆ fertilityPermille()
| double eve::growth::Organism::fertilityPermille | ( | ) |
在文件 Organism.cpp 第 94 行定义.
◆ fertilize()
| Result< void > eve::growth::Organism::fertilize | ( | double | permille | ) |
Adds fertility when the species declares a fertility need. @cost Cheap: O(1) meter write + optional event.
在文件 Organism.cpp 第 135 行定义.
引用了 refillNeed().
◆ foodPermille()
| double eve::growth::Organism::foodPermille | ( | ) |
在文件 Organism.cpp 第 92 行定义.
◆ harvest()
| Result< std::vector< YieldReceipt > > eve::growth::Organism::harvest | ( | ) |
Harvests once when mature and harvestYield is non-empty (any lifeform). @cost Moderate: copies yield defs and marks harvested; emits one event.
在文件 Organism.cpp 第 137 行定义.
引用了 count, eve::Diagnostic::error(), eve::growth::SpeciesRegistry::find(), eve::growth::Harvested, eve::growth::SpeciesDef::harvestYield, eve::growth::GrowthWorld::instance(), eve::InvalidArgument, eve::growth::YieldReceipt::itemId, eve::NotFound, eve::PreconditionViolation , 以及 speciesId().
◆ isDead()
| bool eve::growth::Organism::isDead | ( | ) |
◆ isDiseased()
| bool eve::growth::Organism::isDiseased | ( | ) |
在文件 Organism.cpp 第 84 行定义.
◆ isHarvested()
| bool eve::growth::Organism::isHarvested | ( | ) |
在文件 Organism.cpp 第 82 行定义.
◆ isMature()
| bool eve::growth::Organism::isMature | ( | ) |
在文件 Organism.cpp 第 78 行定义.
被这些函数引用 eve::growth::GrowthWorld::tryBreed() , 以及 eve::growth::GrowthWorld::tryReproduce().
◆ isPregnant()
| bool eve::growth::Organism::isPregnant | ( | ) |
在文件 Organism.cpp 第 86 行定义.
被这些函数引用 eve::growth::GrowthWorld::tryBreed().
◆ kind()
| OrganismKind eve::growth::Organism::kind | ( | ) |
在文件 Organism.cpp 第 64 行定义.
◆ kindId()
| const std::string & eve::growth::Organism::kindId | ( | ) |
在文件 Organism.cpp 第 62 行定义.
◆ liveOrganisms()
|
static |
Live organisms currently visible to Growth views.
在文件 Organism.cpp 第 52 行定义.
被这些函数引用 eve::growth::GrowthWorld::advanceDays() , 以及 eve::growth::GrowthWorld::resetInstance().
◆ needPermille()
| double eve::growth::Organism::needPermille | ( | const std::string & | needId | ) |
Generic meter read; missing need returns 0.
在文件 Organism.cpp 第 96 行定义.
◆ refillNeed()
| Result< void > eve::growth::Organism::refillNeed | ( | const std::string & | needId, |
| double | permille | ||
| ) |
Refills a named need declared by the species. @cost Cheap: O(1) meter write + optional event.
在文件 Organism.cpp 第 98 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::growth::Fed, eve::growth::Fertilized, eve::growth::SpeciesRegistry::find(), eve::growth::SpeciesDef::hasNeed(), eve::growth::GrowthWorld::instance(), eve::InvalidArgument, eve::NotFound, eve::PreconditionViolation, speciesId(), eve::Result< T >::success() , 以及 eve::growth::Watered.
被这些函数引用 feed(), fertilize() , 以及 waterBy().
◆ release()
|
inlineoverride |
在文件 Organism.h 第 33 行定义.
被这些函数引用 destroy(), eve::growth::Growth::plant() , 以及 eve::growth::Growth::spawnAnimal().
◆ speciesId()
| const std::string & eve::growth::Organism::speciesId | ( | ) |
在文件 Organism.cpp 第 60 行定义.
被这些函数引用 createOrganism(), harvest(), refillNeed(), stageId(), eve::growth::GrowthWorld::tryBreed() , 以及 eve::growth::GrowthWorld::tryReproduce().
◆ stableId()
|
noexcept |
Stable ECS id for event correlation.
在文件 Organism.cpp 第 171 行定义.
被这些函数引用 eve::growth::GrowthWorld::tryBreed().
◆ stageId()
| std::string eve::growth::Organism::stageId | ( | ) |
在文件 Organism.cpp 第 68 行定义.
引用了 eve::growth::SpeciesRegistry::find(), index, speciesId() , 以及 eve::growth::SpeciesDef::stages.
◆ stageIndex()
| int eve::growth::Organism::stageIndex | ( | ) |
在文件 Organism.cpp 第 66 行定义.
◆ stageProgressDays()
| double eve::growth::Organism::stageProgressDays | ( | ) |
在文件 Organism.cpp 第 76 行定义.
◆ waterBy()
| Result< void > eve::growth::Organism::waterBy | ( | double | permille | ) |
Adds water when the species declares a water need. @cost Cheap: O(1) meter write + optional event.
在文件 Organism.cpp 第 131 行定义.
引用了 refillNeed().
◆ waterPermille()
| double eve::growth::Organism::waterPermille | ( | ) |
Convenience meters when the species declares water/food/fertility needs.
在文件 Organism.cpp 第 90 行定义.
该类的文档由以下文件生成:
- src/modules/growth/Organism.h
- src/modules/growth/Organism.cpp