QtCraft API C++ classes QML types Handbook

QcHandbookJson Namespace

JSON form of handbook pages, shared by the control interface and the in-game screen (which turns it into QVariantMaps), so both show exactly the same content. More...

Header: #include <common/handbook/QcHandbookJson.h>

Functions

QJsonArray categories(const QcHandbook &handbook)
QJsonObject entry(const QcHandbook &handbook, const QcHandbookEntry &entry)
QJsonObject summary(const QcHandbookEntry &entry)

Detailed Description

Function Documentation

QJsonArray QcHandbookJson::categories(const QcHandbook &handbook)

Returns [{"id", "title", "count"}] of the non-empty categories of handbook.

QJsonObject QcHandbookJson::entry(const QcHandbook &handbook, const QcHandbookEntry &entry)

Returns the page of entry with the category and pack names of handbook: {"id", "name", "category", "categoryTitle", "pack", "packName", "title", "icon", "text", "facts": [{"label", "value", "links": [link], "technical"}], "sections": [{"title", "text", "links": [link], "recipes": [recipe]}]} with link = {"target", "text", "icon", "note"} and recipe = {"kind" ("crafting"/"machine"), "name", "shapeless", "needsTable", "width", "height", "cells": [link or null], "result": link, "count", "seconds", "machines": [link], "note"}.

QJsonObject QcHandbookJson::summary(const QcHandbookEntry &entry)

Returns {"id", "title", "icon", "category", "pack"} of entry for lists and search results.