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.
成员函数说明
◆ findNeed()
|
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.
引用了 needs.
被这些函数引用 hasNeed().
◆ hasNeed()
|
inline |
True when the species declares a need meter with this id.
- 备注
- Inline so SHARED Windows consumers do not need a DLL export.
引用了 findNeed().
被这些函数引用 eve::growth::Organism::refillNeed().
类成员变量说明
◆ baseDiseaseResist
◆ diseases
| std::vector<DiseaseSusceptibility> eve::growth::SpeciesDef::diseases |
◆ displayName
◆ harvestYield
| std::vector<YieldDef> eve::growth::SpeciesDef::harvestYield |
被这些函数引用 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.
被这些函数引用 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, …).
被这些函数引用 eve::growth::Organism::createOrganism(), eve::growth::normalizeSpeciesDef() , 以及 eve::growth::GrowthWorld::tryReproduce().
◆ needs
| std::vector<NeedMeterDef> eve::growth::SpeciesDef::needs |
◆ produceIntervalDays
◆ produceYield
◆ 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.
被这些函数引用 eve::growth::normalizeSpeciesDef().
◆ seasonMulById
| std::unordered_map<std::string, double> eve::growth::SpeciesDef::seasonMulById |
◆ stages
| std::vector<GrowthStageDef> eve::growth::SpeciesDef::stages |
该结构体的文档由以下文件生成:
- src/modules/growth/Species.h