R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
HelpCommand.cpp
Go to the documentation of this file.
1
/*
2
** EPITECH PROJECT, 2025
3
** Created on 14/01/2026.
4
** File description:
5
** HelpCommand.cpp
6
*/
7
8
#include "
HelpCommand.hpp
"
9
#include <sstream>
10
11
namespace
server
{
12
13
std::string
HelpCommand::execute
(
const
std::vector<std::string> &args,
const
CommandContext
&context) {
14
(void)args;
15
(void)context;
16
17
std::ostringstream oss;
18
oss <<
"=== Available Commands ==="
;
19
20
for
(
const
auto
&cmd :
_commands
) {
21
oss <<
"\n"
<< cmd->getUsage() <<
" — "
<< cmd->getDescription();
22
}
23
24
return
oss.str();
25
}
26
27
}
// namespace server
HelpCommand.hpp
server::HelpCommand::execute
std::string execute(const std::vector< std::string > &args, const CommandContext &context) override
Execute the command.
Definition
HelpCommand.cpp:13
server::HelpCommand::_commands
const std::vector< std::shared_ptr< ICommand > > & _commands
Definition
HelpCommand.hpp:35
server
Definition
CommandContext.hpp:16
server::CommandContext
Context information for command execution.
Definition
CommandContext.hpp:28
server
Commands
HelpCommand.cpp
Generated by
1.9.8