Recast  1
Game with custom magic
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
DelayCommand.h
Go to the documentation of this file.
1 
8 #ifndef RECAST_SERVER_DELAYCOMMAND_H
9 #define RECAST_SERVER_DELAYCOMMAND_H
10 
11 #include <string>
12 #include <commands/ICommand.hpp>
13 
14 class ICommandSender;
15 
16 class DelayCommand {
17 public:
19 
20  DelayCommand(ICommandSender *sender, std::shared_ptr<ICommand> command, std::string cmd,
21  std::vector<std::string> args) : sender(
22  sender), command(command), cmd(cmd), args(args) {}
23 
24  void execute() {
25  command->onCommand(*sender, cmd, args);
26  }
27 
28 private:
29  ICommandSender *sender;
30  std::shared_ptr<ICommand> command;
31  std::string cmd;
32  std::vector<std::string> args;
33 };
34 
35 
36 #endif //RECAST_SERVER_DELAYCOMMAND_H
void execute()
Definition: DelayCommand.h:24
DelayCommand()
Definition: DelayCommand.h:18
Definition: DelayCommand.h:16
DelayCommand(ICommandSender *sender, std::shared_ptr< ICommand > command, std::string cmd, std::vector< std::string > args)
Definition: DelayCommand.h:20
Command file.
Definition: ICommandSender.hpp:12