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

Lists all players and spectators in the current room. More...

#include <ListCommand.hpp>

Inheritance diagram for server::ListCommand:
Inheritance graph
Collaboration diagram for server::ListCommand:
Collaboration graph

Public Member Functions

 ListCommand ()=default
 
 ~ListCommand () override=default
 
std::string execute (const std::vector< std::string > &args, const CommandContext &context) override
 Execute the command.
 
std::string getName () const override
 Get command name.
 
std::string getDescription () const override
 Get command description.
 
std::string getUsage () const override
 Get command usage.
 
- Public Member Functions inherited from server::ICommand
virtual ~ICommand ()=default
 

Detailed Description

Lists all players and spectators in the current room.

Usage: /list Displays:

  • All active players in the room
  • All spectators in the room
  • Host indicator

Definition at line 26 of file ListCommand.hpp.

Constructor & Destructor Documentation

◆ ListCommand()

server::ListCommand::ListCommand ( )
default

◆ ~ListCommand()

server::ListCommand::~ListCommand ( )
overridedefault

Member Function Documentation

◆ execute()

std::string server::ListCommand::execute ( const std::vector< std::string > &  args,
const CommandContext context 
)
overridevirtual

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

Implements server::ICommand.

Definition at line 15 of file ListCommand.cpp.

References Server::getLobby(), server::LobbyPlayer::playerName, server::CommandContext::room, and server::CommandContext::server.

Here is the call graph for this function:

◆ getDescription()

std::string server::ListCommand::getDescription ( ) const
inlineoverridevirtual

Get command description.

Returns
Description of what the command does

Implements server::ICommand.

Definition at line 33 of file ListCommand.hpp.

◆ getName()

std::string server::ListCommand::getName ( ) const
inlineoverridevirtual

Get command name.

Returns
The command name (without /)

Implements server::ICommand.

Definition at line 32 of file ListCommand.hpp.

◆ getUsage()

std::string server::ListCommand::getUsage ( ) const
inlineoverridevirtual

Get command usage.

Returns
Usage example/syntax for the command

Implements server::ICommand.

Definition at line 34 of file ListCommand.hpp.


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