载入中...
搜索中...
未找到
eve::growth::SpeciesRegistry类 参考

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.

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

成员函数说明

◆ clear()

void eve::growth::SpeciesRegistry::clear ( )
static

Clears the table (tests).

在文件 Species.cpp 第 550 行定义.

被这些函数引用 eve::growth::Growth::clearSpecies() , 以及 eve::growth::Growth::resetWorld().

◆ count()

int eve::growth::SpeciesRegistry::count ( )
static

Number of registered species.

在文件 Species.cpp 第 546 行定义.

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

◆ find()

const SpeciesDef * eve::growth::SpeciesRegistry::find ( const std::string &  id)
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()

bool eve::growth::SpeciesRegistry::has ( const std::string &  id)
static

True when id is registered.

在文件 Species.cpp 第 548 行定义.

引用了 find().

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

◆ loadFromJson()

Result< int > eve::growth::SpeciesRegistry::loadFromJson ( std::string_view  json)
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().

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

◆ registerSpecies()

Result< void > eve::growth::SpeciesRegistry::registerSpecies ( const SpeciesDef &  def)
static

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