QtCraft API C++ classes QML types Handbook

QcCommandCategories Namespace

The groups of commands as a list, by their words and by their byte in the protocol. More...

Header: #include <common/core/QcCommandCategory.h>

Variables

const qsizetype count

Functions

const std::array<QcCommandCategory, count> &all()
std::optional<QcCommandCategory> fromId(QStringView word)
std::optional<QcCommandCategory> fromWire(quint8 value)
QLatin1StringView id(QcCommandCategory category)

Detailed Description

Variable Documentation

const qsizetype QcCommandCategories::count

The number of groups.

Function Documentation

const std::array<QcCommandCategory, count> &QcCommandCategories::all()

Returns every group in the order /help lists them.

std::optional<QcCommandCategory> QcCommandCategories::fromId(QStringView word)

Returns the group of the word word (case-insensitive); std::nullopt for other words.

std::optional<QcCommandCategory> QcCommandCategories::fromWire(quint8 value)

Returns the group the protocol byte value names; std::nullopt beyond the last.

QLatin1StringView QcCommandCategories::id(QcCommandCategory category)

Returns the word /help takes for the group category ("building").