QtCraft API C++ classes QML types Handbook

QcCommandSyntax::Parameter Struct

struct QcCommandSyntax::Parameter

One word of a form: a literal or a placeholder. More...

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

Public Types

enum class Kind { Literal, Required, Optional }
enum class Type { Word, Text, Player, Integer, Coordinate, …, Named }

Public Variables

QStringList choices
QcCommandSyntax::Parameter::Kind kind
QString name
std::optional<std::pair<qint64, qint64>> range
QcCommandSyntax::Parameter::Type type

Detailed Description

Member Type Documentation

enum class Parameter::Kind

How the word stands in the usage.

ConstantValueDescription
QcCommandSyntax::Parameter::Kind::Literal0A plain word, typed as it is.
QcCommandSyntax::Parameter::Kind::Required1A word that must be given: a placeholder in <...> or plain alternatives a|b.
QcCommandSyntax::Parameter::Kind::Optional2A word that may be left out: anything inside [...].

enum class Parameter::Type

What a placeholder takes, from its name.

ConstantValueDescription
QcCommandSyntax::Parameter::Type::Word0Any single word.
QcCommandSyntax::Parameter::Type::Text1The rest of the line (a reason, a label).
QcCommandSyntax::Parameter::Type::Player2A player's name.
QcCommandSyntax::Parameter::Type::Integer3A whole number (count, seconds, level, a range like 0-16 ...).
QcCommandSyntax::Parameter::Type::Coordinate4A coordinate (x, y, z, x2 ...).
QcCommandSyntax::Parameter::Type::Block5A block.
QcCommandSyntax::Parameter::Type::Item6An item.
QcCommandSyntax::Parameter::Type::Creature7A creature.
QcCommandSyntax::Parameter::Type::Choice8One of the alternatives in choices.
QcCommandSyntax::Parameter::Type::Named9A word the server names with its command (a structure, a biome; QcMsg::AdminCatalogue::Command::names, decision E-911).

Member Variable Documentation

QStringList Parameter::choices

The plain words a choice offers ("on", "off"); a choice with a placeholder among its alternatives (<creature>) also has that placeholder's type.

QcCommandSyntax::Parameter::Kind Parameter::kind

Literal, required or optional.

QString Parameter::name

The literal word, or the placeholder's name as the usage writes it.

std::optional<std::pair<qint64, qint64>> Parameter::range

Integer ranges written as [0-16].

QcCommandSyntax::Parameter::Type Parameter::type

What a placeholder takes; Word for a literal.