QtCraft API C++ classes QML types Handbook

QcCreativeCatalog Class

Every item of the content, mods included, sorted into the tabs of the creative inventory and searchable by name (decision E-286). More...

Header: #include <common/gameplay/QcCreativeCatalog.h>

Public Types

struct Entry
enum class Category { All, Blocks, Parts, Signal, Tools, …, Items }

Public Functions

QcCreativeCatalog()
QcCreativeCatalog(const QcContentRegistry &content, const QString &language)
const QList<QcCreativeCatalog::Entry> &entries() const
QList<const QcCreativeCatalog::Entry *> filter(QcCreativeCatalog::Category category, const QString &query) const

Static Public Members

const int categoryCount
QcCreativeCatalog::Category categoryOf(const QcContentRegistry &content, const QcItemDefinition &item)

Detailed Description

The tabs follow the handbook's categories: blocks, building parts, Signal Dust components (decision E-340), tools and armour, food and other items; "all" shows everything, tab after tab. Within a tab the order is that of the registry (base game first, then the mods in load order).

Member Type Documentation

enum class QcCreativeCatalog::Category

The tabs.

ConstantValueDescription
QcCreativeCatalog::Category::All0Every item, tab after tab.
QcCreativeCatalog::Category::Blocks1Items that place their own block, neither a building part nor a circuit part.
QcCreativeCatalog::Category::Parts2Items that place their own building part (QcBlockDefinition::partOf).
QcCreativeCatalog::Category::Signal3Items that place their own Signal Dust component.
QcCreativeCatalog::Category::Tools4Tools, armour, igniters and launchers.
QcCreativeCatalog::Category::Food5Food.
QcCreativeCatalog::Category::Items6Everything else.

Member Function Documentation

[constexpr noexcept default] QcCreativeCatalog::QcCreativeCatalog()

Default-constructs an instance of QcCreativeCatalog.

QcCreativeCatalog::QcCreativeCatalog(const QcContentRegistry &content, const QString &language)

The items of content with their names in language.

[static] QcCreativeCatalog::Category QcCreativeCatalog::categoryOf(const QcContentRegistry &content, const QcItemDefinition &item)

Returns the tab of item in content: its own block (a building part, a circuit component or another block), tools and armour, food, else other items (buckets, seeds and everything that places a block other than its own).

const QList<QcCreativeCatalog::Entry> &QcCreativeCatalog::entries() const

Returns every entry in catalogue order.

QList<const QcCreativeCatalog::Entry *> QcCreativeCatalog::filter(QcCreativeCatalog::Category category, const QString &query) const

Returns the entries of category (all of them for All) whose search key contains every word of query, ignoring case and accents; in catalogue order.

Member Variable Documentation

const int QcCreativeCatalog::categoryCount

The number of tabs.