载入中...
搜索中...
未找到
eve::procgen::GeneratorRegistry类 参考

Registry for executable generators and their reflection metadata. 更多...

#include <GeneratorRegistry.h>

Public 成员函数

void registerAlgorithm (const std::string &id, GeneratorFn fn)
 Register an algorithm without metadata for backward compatibility.
 
void registerAlgorithm (GeneratorDescriptor descriptor, GeneratorFn fn)
 Register an algorithm together with its dynamic-editor schema.
 
bool has (const std::string &id) const
 Return true when an executable algorithm is registered.
 
bool generate (const std::string &id, const Params &params, Grid2D &out, std::string &error) const
 Execute one registered algorithm.
 
std::vector< std::string > list () const
 Return sorted registered algorithm ids.
 
const GeneratorDescriptor * descriptor (const std::string &id) const
 Return reflection metadata for an algorithm.
 
bool applyDefaults (const std::string &id, Params &params) const
 Fill only missing algorithm-specific values from the registered schema.
 
void registerBuiltins ()
 Register built-in DTL / custom map algorithms (idempotent).
 

静态 Public 成员函数

static GeneratorRegistry & instance ()
 Return the process-wide generator registry.
 

详细描述

Registry for executable generators and their reflection metadata.

在文件 GeneratorRegistry.h 第 23 行定义.

成员函数说明

◆ applyDefaults()

bool eve::procgen::GeneratorRegistry::applyDefaults ( const std::string &  id,
Params &  params 
) const

Fill only missing algorithm-specific values from the registered schema.

参数
idAlgorithm id.
paramsParameters to update.
返回
Whether a schema exists.

在文件 GeneratorRegistry.cpp 第 42 行定义.

引用了 eve::procgen::RecipeDescriptor::applyDefaults(), descriptor , 以及 params.

◆ descriptor()

const GeneratorDescriptor * eve::procgen::GeneratorRegistry::descriptor ( const std::string &  id) const

Return reflection metadata for an algorithm.

参数
idAlgorithm id.
返回
Descriptor or nullptr.

在文件 GeneratorRegistry.cpp 第 37 行定义.

被这些函数引用 eve::procgen::Procgen::getAlgorithmCategory(), eve::procgen::Procgen::getAlgorithmDisplayName(), eve::procgen::Procgen::getAlgorithmParamCount() , 以及 eve::procgen::Procgen::getAlgorithmSchema().

◆ generate()

bool eve::procgen::GeneratorRegistry::generate ( const std::string &  id,
const Params &  params,
Grid2D &  out,
std::string &  error 
) const

Execute one registered algorithm.

参数
idAlgorithm id.
paramsInput parameters.
outOutput grid.
errorError text.
返回
Whether generation succeeded.

在文件 GeneratorRegistry.cpp 第 27 行定义.

引用了 error, id , 以及 params.

◆ has()

bool eve::procgen::GeneratorRegistry::has ( const std::string &  id) const

Return true when an executable algorithm is registered.

参数
idAlgorithm id.
返回
Whether it exists.

在文件 GeneratorRegistry.cpp 第 23 行定义.

被这些函数引用 eve::procgen::Procgen::hasAlgorithm().

◆ instance()

◆ list()

std::vector< std::string > eve::procgen::GeneratorRegistry::list ( ) const

Return sorted registered algorithm ids.

在文件 GeneratorRegistry.cpp 第 49 行定义.

引用了 ids.

被这些函数引用 eve::procgen::Procgen::getAlgorithmCount() , 以及 eve::procgen::Procgen::getAlgorithmId().

◆ registerAlgorithm() [1/2]

void eve::procgen::GeneratorRegistry::registerAlgorithm ( const std::string &  id,
GeneratorFn  fn 
)

◆ registerAlgorithm() [2/2]

void eve::procgen::GeneratorRegistry::registerAlgorithm ( GeneratorDescriptor  descriptor,
GeneratorFn  fn 
)

Register an algorithm together with its dynamic-editor schema.

参数
descriptorSchema and id.
fnGenerator callback.

在文件 GeneratorRegistry.cpp 第 18 行定义.

引用了 descriptor, fn , 以及 id.

◆ registerBuiltins()


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