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
15
namespace
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
ICommand.hpp
server::HelpCommand
Displays available commands to the player.
Definition
HelpCommand.hpp:24
server::HelpCommand::getUsage
std::string getUsage() const override
Get command usage.
Definition
HelpCommand.hpp:32
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::~HelpCommand
~HelpCommand() override=default
server::HelpCommand::HelpCommand
HelpCommand(const std::vector< std::shared_ptr< ICommand > > &commands)
Definition
HelpCommand.hpp:26
server::HelpCommand::_commands
const std::vector< std::shared_ptr< ICommand > > & _commands
Definition
HelpCommand.hpp:35
server::HelpCommand::getName
std::string getName() const override
Get command name.
Definition
HelpCommand.hpp:30
server::HelpCommand::getDescription
std::string getDescription() const override
Get command description.
Definition
HelpCommand.hpp:31
server::ICommand
Interface for all chat commands.
Definition
ICommand.hpp:23
server
Definition
CommandContext.hpp:16
server::CommandContext
Context information for command execution.
Definition
CommandContext.hpp:28
server
Commands
HelpCommand.hpp
Generated by
1.9.8