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

EVENGINE_API_DOMAINS public API. 更多...

#include <TextureRecipe.h>

Public 成员函数

void registerRecipe (const std::string &id, TextureRecipeFn fn)
 Register a recipe without metadata.
 
void registerRecipe (RecipeDescriptor descriptor, TextureRecipeFn fn)
 Register a texture recipe with reusable metadata.
 
bool has (const std::string &id) const
 Test whether a recipe exists.
 
std::unique_ptr< image::ImageData > generate (const std::string &id, const Params &params, std::string &error) const
 Generates an image and transfers its unique ownership to the caller.
 
std::vector< std::string > list () const
 List registered recipe ids.
 
const RecipeDescriptor * descriptor (const std::string &id) const
 Look up recipe metadata.
 
bool applyDefaults (const std::string &id, Params &params) const
 Fill missing values from metadata.
 
void registerBuiltins ()
 Register engine-provided recipes once.
 

静态 Public 成员函数

static TextureRecipeRegistry & instance ()
 Access the process-wide texture recipe registry.
 

详细描述

EVENGINE_API_DOMAINS public API.

在文件 TextureRecipe.h 第 27 行定义.

成员函数说明

◆ applyDefaults()

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

Fill missing values from metadata.

参数
idRecipe id.
paramsValues to update.
返回
False for an unknown recipe.

在文件 TextureRecipe.cpp 第 48 行定义.

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

◆ descriptor()

const RecipeDescriptor * eve::procgen::TextureRecipeRegistry::descriptor ( const std::string &  id) const

Look up recipe metadata.

参数
idRecipe id.
返回
Registry-owned schema or nullptr.

在文件 TextureRecipe.cpp 第 43 行定义.

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

◆ generate()

std::unique_ptr< image::ImageData > eve::procgen::TextureRecipeRegistry::generate ( const std::string &  id,
const Params &  params,
std::string &  error 
) const

Generates an image and transfers its unique ownership to the caller.

参数
idStable recipe id.
paramsValidated recipe parameters.
errorReceives a human-readable failure description when generation fails.
返回
The newly owned image, or null when the recipe is unknown or generation fails. @ownership The returned image is owned by the caller.

在文件 TextureRecipe.cpp 第 33 行定义.

引用了 error, id , 以及 params.

被这些函数引用 eve::procgen_editing::TextureRecipePreviewRuntime::generate() , 以及 eve::procgen::Procgen::generateImageHandle().

◆ has()

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

Test whether a recipe exists.

参数
idRecipe id.
返回
True when registered.

在文件 TextureRecipe.cpp 第 29 行定义.

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

◆ instance()

◆ list()

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

List registered recipe ids.

返回
Sorted ids.

在文件 TextureRecipe.cpp 第 55 行定义.

引用了 ids.

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

◆ registerBuiltins()

◆ registerRecipe() [1/2]

void eve::procgen::TextureRecipeRegistry::registerRecipe ( const std::string &  id,
TextureRecipeFn  fn 
)

◆ registerRecipe() [2/2]

void eve::procgen::TextureRecipeRegistry::registerRecipe ( RecipeDescriptor  descriptor,
TextureRecipeFn  fn 
)

Register a texture recipe with reusable metadata.

参数
descriptorRecipe schema.
fnGenerator callback.

在文件 TextureRecipe.cpp 第 24 行定义.

引用了 descriptor, fn , 以及 id.


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