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
11namespace 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
std::string execute(const std::vector< std::string > &args, const CommandContext &context) override
Execute the command.
const std::vector< std::shared_ptr< ICommand > > & _commands
Context information for command execution.