QtCraft API C++ classes QML types Handbook

QcRecipeParser Namespace

Parses crafting and smelting recipes of content packs. More...

Header: #include <common/content/recipes/QcRecipeParser.h>

Functions

QcResult<QcRecipeDefinition> parseRecipe(const QJsonObject &json, const QString &packNamespace)
QcResult<QcSmeltingRecipe> parseSmeltingRecipe(const QJsonObject &json, const QString &packNamespace)
QcResult<QcSmeltingRecipe> parseStonecuttingRecipe(const QJsonObject &json, const QString &packNamespace)

Detailed Description

Function Documentation

QcResult<QcRecipeDefinition> QcRecipeParser::parseRecipe(const QJsonObject &json, const QString &packNamespace)

Returns the crafting recipe read from json, its names qualified with packNamespace, or the first failure. The pattern loses blank rows and columns at its edges.

QcResult<QcSmeltingRecipe> QcRecipeParser::parseSmeltingRecipe(const QJsonObject &json, const QString &packNamespace)

Returns the smelting recipe read from json, its names qualified with packNamespace, or the first failure; the category "stonecutting" is refused.

QcResult<QcSmeltingRecipe> QcRecipeParser::parseStonecuttingRecipe(const QJsonObject &json, const QString &packNamespace)

Returns the stonecutting recipe (decision E-784) read from json, its names qualified with packNamespace, or the first failure: the fields of a smelting recipe, always of the category "stonecutting" (a "category" in the file is ignored); seconds and experience mean nothing to it. A name longer than QcStonecutting::maxRecipeName is refused.