The arguments of a command being run, read in their types.
More...
#include <aegis2d/core/commands.hpp>
|
| | CommandCall (std::span< const CommandArg > arguments, std::vector< std::optional< VarValue > > values) |
| | Arguments as read.
|
| |
| bool | has (std::string_view argument) const |
| | Tells whether an argument was given.
|
| |
| const std::string & | text (std::string_view argument) const |
| | A text argument.
|
| |
| std::int64_t | integer (std::string_view argument) const |
| | An integer argument.
|
| |
| double | number (std::string_view argument) const |
| | A number argument; an integer argument reads as a number too.
|
| |
| bool | boolean (std::string_view argument) const |
| | A boolean argument.
|
| |
The arguments of a command being run, read in their types.
◆ CommandCall()
| aegis2d::core::CommandCall::CommandCall |
( |
std::span< const CommandArg > |
arguments, |
|
|
std::vector< std::optional< VarValue > > |
values |
|
) |
| |
Arguments as read.
- Parameters
-
| arguments | What the command takes. |
| values | Value of each argument, in the same order; nothing for one left out. |
◆ boolean()
| bool aegis2d::core::CommandCall::boolean |
( |
std::string_view |
argument | ) |
const |
A boolean argument.
- Parameters
-
- Returns
- Its value.
- Exceptions
-
◆ has()
| bool aegis2d::core::CommandCall::has |
( |
std::string_view |
argument | ) |
const |
Tells whether an argument was given.
- Parameters
-
- Returns
false for an optional argument left out.
- Exceptions
-
| std::out_of_range | if the command has no such argument. |
◆ integer()
| std::int64_t aegis2d::core::CommandCall::integer |
( |
std::string_view |
argument | ) |
const |
An integer argument.
- Parameters
-
- Returns
- Its value.
- Exceptions
-
◆ number()
| double aegis2d::core::CommandCall::number |
( |
std::string_view |
argument | ) |
const |
A number argument; an integer argument reads as a number too.
- Parameters
-
- Returns
- Its value.
- Exceptions
-
◆ text()
| const std::string & aegis2d::core::CommandCall::text |
( |
std::string_view |
argument | ) |
const |
A text argument.
- Parameters
-
- Returns
- Its value.
- Exceptions
-
| std::out_of_range | if the command has no such argument or it was left out. |
| std::bad_variant_access | if it is of another type. |
The documentation for this class was generated from the following file: