载入中...
搜索中...
未找到
Species.h
浏览该文件的文档.
112 [[nodiscard]] bool hasNeed(std::string_view needId) const { return findNeed(needId) != nullptr; }
154[[nodiscard]] EVENGINE_API_FOUNDATION Result<OrganismKind> parseOrganismKind(std::string_view text);
156[[nodiscard]] EVENGINE_API_FOUNDATION Result<ReproductionMode> parseReproductionMode(std::string_view text);
Move-only, checked operation results for the common layer.
Process-wide species table used by GrowthWorld and Organism factories.
Definition Species.h:129
Definition Growth.cpp:11
Result< OrganismKind > parseOrganismKind(std::string_view text)
Parses kind text: plant/animal/custom or any free-form tag → Custom.
Definition Species.cpp:401
ReproductionMode
Authored reproduction strategy — pair gestation is only one mode.
Definition Species.h:44
@ PairGestation
Two parents; carrier gestates then spawns offspring.
@ Fission
Single parent splits; optional parent death or stage reset.
@ SelfBud
Single mature parent; interval then spawn (alien budding).
Result< void > normalizeSpeciesDef(SpeciesDef &def)
Fills needs/reproduction from legacy plant/animal fields when authors omit the new schema....
Definition Species.cpp:428
Result< ReproductionMode > parseReproductionMode(std::string_view text)
Parses reproduction.mode text.
Definition Species.cpp:411
OrganismKind
Optional Earth-biology label; custom lifeforms use Custom + free-form kindId.
Definition Species.h:18
Per-day infection chance while the organism is stressed.
Definition Species.h:67
double durationDays
Duration of the disease in simulation days when contracted.
Definition Species.h:71
Named vital meter (water, radiation, ether, …) — not fixed to Earth biology.
Definition Species.h:35
Species reproduction parameters selected by ReproductionMode.
Definition Species.h:53
std::string offspringSpeciesId
Definition Species.h:59
bool parentResetsStagesOnBirth
Definition Species.h:63
bool partnerMustSameSpecies
Definition Species.h:61
Static species definition — fully data-driven life cycle.
Definition Species.h:81
const NeedMeterDef * findNeed(std::string_view needId) const
Looks up a need meter; nullptr when absent. @ownership Borrowed from this SpeciesDef; caller must not...
Definition Species.h:120
std::unordered_map< std::string, double > seasonMulById
Optional multipliers keyed by calendar season id (preferred when set).
Definition Species.h:97
OrganismKind kind
Convenience label derived from kindId when plant/animal; else Custom.
Definition Species.h:87
bool hasNeed(std::string_view needId) const
True when the species declares a need meter with this id.
Definition Species.h:112
std::vector< double > seasonMul
Growth multipliers indexed by calendar season order.
Definition Species.h:95
std::vector< DiseaseSusceptibility > diseases
Definition Species.h:105