载入中...
搜索中...
未找到
eve::growth::SpeciesDef结构体 参考

Static species definition — fully data-driven life cycle. 更多...

#include <Species.h>

Public 成员函数

bool hasNeed (std::string_view needId) const
 True when the species declares a need meter with this id.
 
const NeedMeterDef * findNeed (std::string_view needId) const
 Looks up a need meter; nullptr when absent. @ownership Borrowed from this SpeciesDef; caller must not free it. @lifetime Valid while this SpeciesDef remains alive / registered. @nullable Yes when the id is unknown.
 

Public 属性

std::string id
 
std::string displayName
 
std::string kindId = "organism"
 Free-form lifeform tag (plant, animal, xeno.crystal, …).
 
OrganismKind kind = OrganismKind::Custom
 Convenience label derived from kindId when plant/animal; else Custom.
 
std::vector< GrowthStageDef > stages
 
std::vector< NeedMeterDef > needs
 
std::vector< double > seasonMul = {1.0, 1.0, 1.0, 1.0}
 Growth multipliers indexed by calendar season order.
 
std::unordered_map< std::string, double > seasonMulById
 Optional multipliers keyed by calendar season id (preferred when set).
 
std::vector< YieldDef > harvestYield
 
std::vector< YieldDef > produceYield
 
double produceIntervalDays = 0.0
 
ReproductionDef reproduction
 
std::vector< DiseaseSusceptibility > diseases
 
double baseDiseaseResist = 0.5
 

详细描述

Static species definition — fully data-driven life cycle.

备注
Definitions are not ECS entities. Register via SpeciesRegistry. Legacy plant/animal JSON fields still parse and normalize into needs/reproduction.

在文件 Species.h 第 81 行定义.

成员函数说明

◆ findNeed()

const NeedMeterDef * eve::growth::SpeciesDef::findNeed ( std::string_view  needId) const
inline

Looks up a need meter; nullptr when absent. @ownership Borrowed from this SpeciesDef; caller must not free it. @lifetime Valid while this SpeciesDef remains alive / registered. @nullable Yes when the id is unknown.

备注
Inline so SHARED Windows consumers do not need a DLL export.

在文件 Species.h 第 120 行定义.

引用了 needs.

被这些函数引用 hasNeed().

◆ hasNeed()

bool eve::growth::SpeciesDef::hasNeed ( std::string_view  needId) const
inline

True when the species declares a need meter with this id.

备注
Inline so SHARED Windows consumers do not need a DLL export.

在文件 Species.h 第 112 行定义.

引用了 findNeed().

被这些函数引用 eve::growth::Organism::refillNeed().

类成员变量说明

◆ baseDiseaseResist

double eve::growth::SpeciesDef::baseDiseaseResist = 0.5

在文件 Species.h 第 106 行定义.

◆ diseases

std::vector<DiseaseSusceptibility> eve::growth::SpeciesDef::diseases

在文件 Species.h 第 105 行定义.

◆ displayName

std::string eve::growth::SpeciesDef::displayName

在文件 Species.h 第 83 行定义.

◆ harvestYield

std::vector<YieldDef> eve::growth::SpeciesDef::harvestYield

在文件 Species.h 第 99 行定义.

被这些函数引用 eve::growth::Organism::harvest().

◆ id

std::string eve::growth::SpeciesDef::id

◆ kind

OrganismKind eve::growth::SpeciesDef::kind = OrganismKind::Custom

Convenience label derived from kindId when plant/animal; else Custom.

在文件 Species.h 第 87 行定义.

被这些函数引用 eve::growth::Organism::createOrganism(), eve::growth::normalizeSpeciesDef() , 以及 eve::growth::SpeciesRegistry::registerSpecies().

◆ kindId

std::string eve::growth::SpeciesDef::kindId = "organism"

Free-form lifeform tag (plant, animal, xeno.crystal, …).

在文件 Species.h 第 85 行定义.

被这些函数引用 eve::growth::Organism::createOrganism(), eve::growth::normalizeSpeciesDef() , 以及 eve::growth::GrowthWorld::tryReproduce().

◆ needs

std::vector<NeedMeterDef> eve::growth::SpeciesDef::needs

◆ produceIntervalDays

double eve::growth::SpeciesDef::produceIntervalDays = 0.0

在文件 Species.h 第 101 行定义.

◆ produceYield

std::vector<YieldDef> eve::growth::SpeciesDef::produceYield

在文件 Species.h 第 100 行定义.

◆ reproduction

ReproductionDef eve::growth::SpeciesDef::reproduction

◆ seasonMul

std::vector<double> eve::growth::SpeciesDef::seasonMul = {1.0, 1.0, 1.0, 1.0}

Growth multipliers indexed by calendar season order.

备注
Empty means 1.0 for every season. Length need not be 4.

在文件 Species.h 第 95 行定义.

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

◆ seasonMulById

std::unordered_map<std::string, double> eve::growth::SpeciesDef::seasonMulById

Optional multipliers keyed by calendar season id (preferred when set).

在文件 Species.h 第 97 行定义.

◆ stages

std::vector<GrowthStageDef> eve::growth::SpeciesDef::stages

在文件 Species.h 第 88 行定义.

被这些函数引用 eve::growth::SpeciesRegistry::registerSpecies() , 以及 eve::growth::Organism::stageId().


该结构体的文档由以下文件生成: