R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
HelpCommand.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** Created on 14/01/2026.
4** File description:
5** HelpCommand.hpp
6*/
7
8#pragma once
9
10#include <memory>
11#include <string>
12#include <vector>
13#include "ICommand.hpp"
14
15namespace server {
16
24 class HelpCommand : public ICommand {
25 public:
26 HelpCommand(const std::vector<std::shared_ptr<ICommand>> &commands) : _commands(commands) {}
27 ~HelpCommand() override = default;
28
29 std::string execute(const std::vector<std::string> &args, const CommandContext &context) override;
30 std::string getName() const override { return "help"; }
31 std::string getDescription() const override { return "Display available commands"; }
32 std::string getUsage() const override { return "/help"; }
33
34 private:
35 const std::vector<std::shared_ptr<ICommand>> &_commands;
36 };
37
38} // namespace server
Displays available commands to the player.
std::string getUsage() const override
Get command usage.
std::string execute(const std::vector< std::string > &args, const CommandContext &context) override
Execute the command.
~HelpCommand() override=default
HelpCommand(const std::vector< std::shared_ptr< ICommand > > &commands)
const std::vector< std::shared_ptr< ICommand > > & _commands
std::string getName() const override
Get command name.
std::string getDescription() const override
Get command description.
Interface for all chat commands.
Definition ICommand.hpp:23
Context information for command execution.