载入中...
搜索中...
未找到
eve::procgen::RecipeDescriptor结构体 参考

Complete metadata and parameter schema shared by every procgen recipe family. 更多...

#include <ParamSchema.h>

Public 成员函数

const ParamDescriptor * find (const std::string &key) const
 Find one parameter descriptor by stable key.
 
void applyDefaults (Params &params) const
 Fill missing Params values from this schema.
 
int getParamCount () const
 Return the number of reflected parameters.
 
std::string getId () const
 Return the stable recipe id.
 
std::string getDisplayName () const
 Return the human-readable recipe name.
 
std::string getCategory () const
 Return the recipe browser category.
 
std::string getParamKey (int index) const
 Return a parameter key by index.
 
std::string getParamLabel (int index) const
 Return a parameter label by index.
 
std::string getParamDescription (int index) const
 Return parameter help text by index.
 
std::string getParamCategory (int index) const
 Return a parameter category by index.
 
std::string getParamKind (int index) const
 Return the portable parameter kind.
 
std::string getParamDefault (int index) const
 Return the schema default encoded as text.
 
bool paramHasMinimum (int index) const
 Test whether a numeric minimum exists.
 
bool paramHasMaximum (int index) const
 Test whether a numeric maximum exists.
 
float getParamMinimum (int index) const
 Return a numeric minimum.
 
float getParamMaximum (int index) const
 Return a numeric maximum.
 
float getParamStep (int index) const
 Return the suggested numeric editing step.
 
bool isParamAdvanced (int index) const
 Test whether compact inspectors should hide the field.
 
int getParamChoiceCount (int index) const
 Return the number of choices for one parameter.
 
std::string getParamChoice (int paramIndex, int choiceIndex) const
 Return one choice.
 

静态 Public 成员函数

static RecipeDescriptor grid (std::string id, std::string displayName, std::string category, int minimumWidth, int minimumHeight, int maximumWidth=4096, int maximumHeight=4096)
 Create a schema with common seed, width and height parameters.
 

Public 属性

std::string id
 
std::string displayName
 
std::string category
 
std::vector< ParamDescriptor > params
 

详细描述

Complete metadata and parameter schema shared by every procgen recipe family.

在文件 ParamSchema.h 第 52 行定义.

成员函数说明

◆ applyDefaults()

void eve::procgen::RecipeDescriptor::applyDefaults ( Params &  params) const

◆ find()

const ParamDescriptor * eve::procgen::RecipeDescriptor::find ( const std::string &  key) const

Find one parameter descriptor by stable key.

参数
keyParameter key.
返回
Schema-owned descriptor or nullptr.

在文件 ParamSchema.cpp 第 85 行定义.

引用了 params.

被这些函数引用 eve::procgen::MeshRecipeRegistry::descriptor().

◆ getCategory()

std::string eve::procgen::RecipeDescriptor::getCategory ( ) const
inline

Return the recipe browser category.

返回
Category name.

在文件 ParamSchema.h 第 77 行定义.

引用了 category.

◆ getDisplayName()

std::string eve::procgen::RecipeDescriptor::getDisplayName ( ) const
inline

Return the human-readable recipe name.

返回
Display name.

在文件 ParamSchema.h 第 75 行定义.

◆ getId()

std::string eve::procgen::RecipeDescriptor::getId ( ) const
inline

Return the stable recipe id.

返回
Recipe id.

在文件 ParamSchema.h 第 73 行定义.

引用了 id.

◆ getParamCategory()

std::string eve::procgen::RecipeDescriptor::getParamCategory ( int  index) const

Return a parameter category by index.

参数
indexParameter index.
返回
Category or empty text.

在文件 ParamSchema.cpp 第 123 行定义.

引用了 at, eve::procgen::ParamDescriptor::category , 以及 index.

◆ getParamChoice()

std::string eve::procgen::RecipeDescriptor::getParamChoice ( int  paramIndex,
int  choiceIndex 
) const

Return one choice.

参数
paramIndexParameter index.
choiceIndexChoice index.
返回
Choice or empty text.

在文件 ParamSchema.cpp 第 181 行定义.

引用了 at , 以及 eve::procgen::ParamDescriptor::choices.

◆ getParamChoiceCount()

int eve::procgen::RecipeDescriptor::getParamChoiceCount ( int  index) const

Return the number of choices for one parameter.

参数
indexParameter index.
返回
Choice count.

在文件 ParamSchema.cpp 第 176 行定义.

引用了 at, eve::procgen::ParamDescriptor::choices , 以及 index.

◆ getParamCount()

int eve::procgen::RecipeDescriptor::getParamCount ( ) const
inline

Return the number of reflected parameters.

返回
Parameter count.

在文件 ParamSchema.h 第 71 行定义.

引用了 params.

◆ getParamDefault()

std::string eve::procgen::RecipeDescriptor::getParamDefault ( int  index) const

Return the schema default encoded as text.

参数
indexParameter index.
返回
Encoded default or empty text.

在文件 ParamSchema.cpp 第 141 行定义.

引用了 at, eve::procgen::ParamDescriptor::defaultValue , 以及 index.

◆ getParamDescription()

std::string eve::procgen::RecipeDescriptor::getParamDescription ( int  index) const

Return parameter help text by index.

参数
indexParameter index.
返回
Help text or empty text.

在文件 ParamSchema.cpp 第 118 行定义.

引用了 at, eve::procgen::ParamDescriptor::description , 以及 index.

◆ getParamKey()

std::string eve::procgen::RecipeDescriptor::getParamKey ( int  index) const

Return a parameter key by index.

参数
indexParameter index.
返回
Key or empty text.

在文件 ParamSchema.cpp 第 108 行定义.

引用了 at, index , 以及 eve::procgen::ParamDescriptor::key.

◆ getParamKind()

std::string eve::procgen::RecipeDescriptor::getParamKind ( int  index) const

Return the portable parameter kind.

参数
indexParameter index.
返回
int, float, bool, string, choice, or empty text.

在文件 ParamSchema.cpp 第 128 行定义.

引用了 at, eve::procgen::Boolean, eve::procgen::Choice, eve::procgen::Float, index, eve::procgen::Integer, eve::procgen::ParamDescriptor::kind , 以及 eve::procgen::String.

◆ getParamLabel()

std::string eve::procgen::RecipeDescriptor::getParamLabel ( int  index) const

Return a parameter label by index.

参数
indexParameter index.
返回
Label or empty text.

在文件 ParamSchema.cpp 第 113 行定义.

引用了 at, eve::procgen::ParamDescriptor::displayName , 以及 index.

◆ getParamMaximum()

float eve::procgen::RecipeDescriptor::getParamMaximum ( int  index) const

Return a numeric maximum.

参数
indexParameter index.
返回
Maximum or zero.

在文件 ParamSchema.cpp 第 161 行定义.

引用了 at, index , 以及 eve::procgen::ParamDescriptor::maximum.

◆ getParamMinimum()

float eve::procgen::RecipeDescriptor::getParamMinimum ( int  index) const

Return a numeric minimum.

参数
indexParameter index.
返回
Minimum or zero.

在文件 ParamSchema.cpp 第 156 行定义.

引用了 at, index , 以及 eve::procgen::ParamDescriptor::minimum.

◆ getParamStep()

float eve::procgen::RecipeDescriptor::getParamStep ( int  index) const

Return the suggested numeric editing step.

参数
indexParameter index.
返回
Step or zero.

在文件 ParamSchema.cpp 第 166 行定义.

引用了 at, index , 以及 eve::procgen::ParamDescriptor::step.

◆ grid()

RecipeDescriptor eve::procgen::RecipeDescriptor::grid ( std::string  id,
std::string  displayName,
std::string  category,
int  minimumWidth,
int  minimumHeight,
int  maximumWidth = 4096,
int  maximumHeight = 4096 
)
static

Create a schema with common seed, width and height parameters.

参数
idStable recipe id.
displayNameDisplay name.
categoryBrowser category.
minimumWidthMinimum width.
minimumHeightMinimum height.
maximumWidthMaximum width.
maximumHeightMaximum height.
返回
Recipe metadata.

在文件 ParamSchema.cpp 第 73 行定义.

引用了 category, displayName, id, eve::procgen::ParamDescriptor::integer() , 以及 params.

被这些函数引用 eve::procgen::makeTextureRecipeDescriptor(), eve::procgen::GeneratorRegistry::registerBuiltins(), eve::procgen::TextureRecipeRegistry::registerBuiltins(), eve::procgen::road::registerRoadTextureRecipes(), eve::procgen::registerTerrainHeightmapAlgorithm() , 以及 eve::procgen::registerWfcSimple().

◆ isParamAdvanced()

bool eve::procgen::RecipeDescriptor::isParamAdvanced ( int  index) const

Test whether compact inspectors should hide the field.

参数
indexParameter index.
返回
Advanced flag.

在文件 ParamSchema.cpp 第 171 行定义.

引用了 eve::procgen::ParamDescriptor::advanced, at , 以及 index.

◆ paramHasMaximum()

bool eve::procgen::RecipeDescriptor::paramHasMaximum ( int  index) const

Test whether a numeric maximum exists.

参数
indexParameter index.
返回
True when bounded above.

在文件 ParamSchema.cpp 第 151 行定义.

引用了 at, eve::procgen::ParamDescriptor::hasMaximum , 以及 index.

◆ paramHasMinimum()

bool eve::procgen::RecipeDescriptor::paramHasMinimum ( int  index) const

Test whether a numeric minimum exists.

参数
indexParameter index.
返回
True when bounded below.

在文件 ParamSchema.cpp 第 146 行定义.

引用了 at, eve::procgen::ParamDescriptor::hasMinimum , 以及 index.

类成员变量说明

◆ category

◆ displayName

◆ id

◆ params


该结构体的文档由以下文件生成: