Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
Command Struct Reference

Command struct. More...

#include <commands.h>

Public Types

typedef std::function< void(const ISender::SenderType, ISender &, const std::vector< std::string > &) HandlerType)
 Function handler type.
 

Public Attributes

std::string name
 The name of the command.
 
std::string usage
 The usage of the command.
 
std::string description
 The description of the command.
 
HandlerType handler
 Command handler.
 

Detailed Description

Command struct.

The structure that holds all data that a command should have.

Member Typedef Documentation

◆ HandlerType

typedef std::function<void(const ISender::SenderType, ISender &, const std::vector<std::string> &) Command::HandlerType)

Function handler type.

The type for a function handling a command.

Member Data Documentation

◆ description

std::string Command::description

The description of the command.

The description shown in the help message of what it does.

◆ handler

HandlerType Command::handler

Command handler.

The function that will handle the command.

◆ name

std::string Command::name

The name of the command.

Not the actual name. But more like the label of the command like for the Ping command the name is ping so that it can be invoked with /ping Should follow the following regex : [a-z][a-z-A-Z]+

◆ usage

std::string Command::usage

The usage of the command.

So that for a command that can be invoked as such : /msg Player123 This is a message The usage should be this : <Player:PlayerName> [quiet] <...message> The optional parameters being indicated with [param] and the mandatory ones with <param>. A parameter that takes all the remaining one should be listed as <...param> or [...param] if it is optional. The type is indicated after the :.


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