QcCommandSyntax::Parameter Struct
struct QcCommandSyntax::ParameterOne 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.
| Constant | Value | Description |
|---|---|---|
QcCommandSyntax::Parameter::Kind::Literal | 0 | A plain word, typed as it is. |
QcCommandSyntax::Parameter::Kind::Required | 1 | A word that must be given: a placeholder in <...> or plain alternatives a|b. |
QcCommandSyntax::Parameter::Kind::Optional | 2 | A word that may be left out: anything inside [...]. |
enum class Parameter::Type
What a placeholder takes, from its name.
| Constant | Value | Description |
|---|---|---|
QcCommandSyntax::Parameter::Type::Word | 0 | Any single word. |
QcCommandSyntax::Parameter::Type::Text | 1 | The rest of the line (a reason, a label). |
QcCommandSyntax::Parameter::Type::Player | 2 | A player's name. |
QcCommandSyntax::Parameter::Type::Integer | 3 | A whole number (count, seconds, level, a range like 0-16 ...). |
QcCommandSyntax::Parameter::Type::Coordinate | 4 | A coordinate (x, y, z, x2 ...). |
QcCommandSyntax::Parameter::Type::Block | 5 | A block. |
QcCommandSyntax::Parameter::Type::Item | 6 | An item. |
QcCommandSyntax::Parameter::Type::Creature | 7 | A creature. |
QcCommandSyntax::Parameter::Type::Choice | 8 | One of the alternatives in choices. |
QcCommandSyntax::Parameter::Type::Named | 9 | A 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.