Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::core::CommandCall Class Reference

The arguments of a command being run, read in their types. More...

#include <aegis2d/core/commands.hpp>

Public Member Functions

 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.
 

Detailed Description

The arguments of a command being run, read in their types.

Constructor & Destructor Documentation

◆ CommandCall()

aegis2d::core::CommandCall::CommandCall ( std::span< const CommandArg >  arguments,
std::vector< std::optional< VarValue > >  values 
)

Arguments as read.

Parameters
argumentsWhat the command takes.
valuesValue of each argument, in the same order; nothing for one left out.

Member Function Documentation

◆ boolean()

bool aegis2d::core::CommandCall::boolean ( std::string_view  argument) const

A boolean argument.

Parameters
argumentIts name.
Returns
Its value.
Exceptions
astext().

◆ has()

bool aegis2d::core::CommandCall::has ( std::string_view  argument) const

Tells whether an argument was given.

Parameters
argumentIts name.
Returns
false for an optional argument left out.
Exceptions
std::out_of_rangeif the command has no such argument.

◆ integer()

std::int64_t aegis2d::core::CommandCall::integer ( std::string_view  argument) const

An integer argument.

Parameters
argumentIts name.
Returns
Its value.
Exceptions
astext().

◆ number()

double aegis2d::core::CommandCall::number ( std::string_view  argument) const

A number argument; an integer argument reads as a number too.

Parameters
argumentIts name.
Returns
Its value.
Exceptions
astext().

◆ text()

const std::string & aegis2d::core::CommandCall::text ( std::string_view  argument) const

A text argument.

Parameters
argumentIts name.
Returns
Its value.
Exceptions
std::out_of_rangeif the command has no such argument or it was left out.
std::bad_variant_accessif it is of another type.

The documentation for this class was generated from the following file: