载入中...
搜索中...
未找到

Growth short-root entity for any configured lifeform. 更多...

#include <Organism.h>

类 eve::growth::Organism 继承关系图:

类

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()

Result< Organism * > eve::growth::Organism::createOrganism ( const std::string &  speciesId)
static

Creates an organism bound to a registered species.

参数
speciesIdMust 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 ( )

Script destroy entry (aliases release).

在文件 Organism.cpp 第 175 行定义.

引用了 release().

◆ 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()

const std::vector< Organism * > & eve::growth::Organism::liveOrganisms ( )
static

Live organisms currently visible to Growth views.

在文件 Organism.cpp 第 52 行定义.

引用了 resolved , 以及 view.

被这些函数引用 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 
)

◆ release()

void eve::growth::Organism::release ( )
inlineoverride

在文件 Organism.h 第 33 行定义.

被这些函数引用 destroy(), eve::growth::Growth::plant() , 以及 eve::growth::Growth::spawnAnimal().

◆ speciesId()

const std::string & eve::growth::Organism::speciesId ( )

◆ stableId()

std::uint64_t eve::growth::Organism::stableId ( ) const
noexcept

Stable ECS id for event correlation.

在文件 Organism.cpp 第 171 行定义.

被这些函数引用 eve::growth::GrowthWorld::tryBreed().

◆ stageId()

std::string eve::growth::Organism::stageId ( )

◆ 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 行定义.


该类的文档由以下文件生成: