R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
server::ICommand Class Referenceabstract

Interface for all chat commands. More...

#include <ICommand.hpp>

Inheritance diagram for server::ICommand:
Inheritance graph
Collaboration diagram for server::ICommand:
Collaboration graph

Public Member Functions

virtual ~ICommand ()=default
 
virtual std::string execute (const std::vector< std::string > &args, const CommandContext &context)=0
 Execute the command.
 
virtual std::string getName () const =0
 Get command name.
 
virtual std::string getDescription () const =0
 Get command description.
 
virtual std::string getUsage () const =0
 Get command usage.
 

Detailed Description

Interface for all chat commands.

Defines the contract for all command implementations. Each command must be able to execute with given arguments and context.

Definition at line 23 of file ICommand.hpp.

Constructor & Destructor Documentation

◆ ~ICommand()

virtual server::ICommand::~ICommand ( )
virtualdefault

Member Function Documentation

◆ execute()

virtual std::string server::ICommand::execute ( const std::vector< std::string > &  args,
const CommandContext context 
)
pure virtual

Execute the command.

Parameters
argsCommand arguments (without the command name)
contextExecution context with player and room information
Returns
Response message to send to the player

Implemented in server::HelpCommand, server::KickCommand, and server::ListCommand.

◆ getDescription()

virtual std::string server::ICommand::getDescription ( ) const
pure virtual

Get command description.

Returns
Description of what the command does

Implemented in server::HelpCommand, server::KickCommand, and server::ListCommand.

◆ getName()

virtual std::string server::ICommand::getName ( ) const
pure virtual

Get command name.

Returns
The command name (without /)

Implemented in server::HelpCommand, server::KickCommand, and server::ListCommand.

◆ getUsage()

virtual std::string server::ICommand::getUsage ( ) const
pure virtual

Get command usage.

Returns
Usage example/syntax for the command

Implemented in server::HelpCommand, server::KickCommand, and server::ListCommand.


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