Process-wide species table used by GrowthWorld and Organism factories. 更多...
#include <Species.h>
静态 Public 成员函数 | |
| static Result< void > | registerSpecies (const SpeciesDef &def) |
| Registers or replaces a species after normalizing legacy fields. Empty id fails. | |
| static Result< int > | loadFromJson (std::string_view json) |
| Parses a JSON object or array of species and registers each. | |
| static const SpeciesDef * | find (const std::string &id) |
Looks up a species; nullptr when missing. @ownership Borrowed from the process-wide registry; caller must not free it. @lifetime Valid until the next registerSpecies / loadFromJson / clear. @nullable Yes when the id is unknown. | |
| static int | count () |
| Number of registered species. | |
| static bool | has (const std::string &id) |
| True when id is registered. | |
| static void | clear () |
| Clears the table (tests). | |
详细描述
Process-wide species table used by GrowthWorld and Organism factories.
成员函数说明
◆ clear()
|
static |
Clears the table (tests).
在文件 Species.cpp 第 550 行定义.
被这些函数引用 eve::growth::Growth::clearSpecies() , 以及 eve::growth::Growth::resetWorld().
◆ count()
|
static |
Number of registered species.
在文件 Species.cpp 第 546 行定义.
被这些函数引用 eve::growth::Growth::speciesCount().
◆ find()
|
static |
Looks up a species; nullptr when missing. @ownership Borrowed from the process-wide registry; caller must not free it. @lifetime Valid until the next registerSpecies / loadFromJson / clear. @nullable Yes when the id is unknown.
在文件 Species.cpp 第 540 行定义.
引用了 end.
被这些函数引用 eve::growth::Organism::createOrganism(), eve::growth::Organism::harvest(), has(), eve::growth::Organism::refillNeed(), eve::growth::Organism::stageId(), eve::growth::GrowthWorld::tryBreed() , 以及 eve::growth::GrowthWorld::tryReproduce().
◆ has()
|
static |
True when id is registered.
在文件 Species.cpp 第 548 行定义.
引用了 find().
被这些函数引用 eve::growth::Growth::hasSpecies().
◆ loadFromJson()
|
static |
Parses a JSON object or array of species and registers each.
在文件 Species.cpp 第 508 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::Value::fromJson(), eve::Value::getIf(), eve::InvalidArgument, ok, registerSpecies(), root , 以及 eve::Result< T >::success().
◆ registerSpecies()
|
static |
Registers or replaces a species after normalizing legacy fields. Empty id fails.
在文件 Species.cpp 第 481 行定义.
引用了 eve::growth::Animal, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::growth::SpeciesDef::id, eve::InvalidArgument, eve::growth::SpeciesDef::kind, eve::growth::SpeciesDef::needs, eve::growth::normalizeSpeciesDef(), ok, eve::growth::Plant, eve::growth::SpeciesDef::stages , 以及 eve::Result< T >::success().
被这些函数引用 loadFromJson().
该类的文档由以下文件生成:
- src/modules/growth/Species.h
- src/modules/growth/Species.cpp