Debian Codegraph @

plugins/script/ScriptCommand.h

raw
1 #pragma once
2
3 #include "iscript.h"
4 #include <string>
5 #include <memory>
6
7 namespace script
8 {
9
10 // Forward decl.
11 class ScriptingSystem;
12
13 class ScriptCommand :
14 public IScriptCommand
15 {
16 private:
17 // The name of this command
18 std::string _name;
19
20 // Caption for the menus
21 std::string _displayName;
22
23 // The script file name to execute (relative to scripts/ folder)
24 std::string _scriptFilename;
25
26 public:
27 using Ptr = std::shared_ptr<ScriptCommand>;
28
29 ScriptCommand(const std::string& name,
30 const std::string& displayName,
31 const std::string& scriptFilename);
32
33 ~ScriptCommand() override;
34
35 const std::string& getName() const override
36 {
37 return _name;
38 }
39
40 const std::string& getFilename() const override
41 {
42 return _scriptFilename;
43 }
44
45 const std::string& getDisplayName() const override
46 {
47 return _displayName;
48 }
49 };
50
51 } // namespace script