Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
h2help.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../console.h"
4 
5 #include <set>
6 
8 
10 {
19  {
20  public:
22  {
23  name = "old_help";
24  description = "prints a description of the named function.";
25  syntax = "help <string>";
26  aliases = { "chelp", "h2help" };
27 
29  }
30 
31  BlamResult Execute(std::vector<std::string> arguments)
32  {
33  if (arguments.size() == 0)
34  {
35  return BlamResult::Error_Command_WrongArgumentCount;
36  }
37  else
38  {
40 
41  if (cmd)
42  {
43  std::string title = "";
44 
45  if (cmd->syntax == "")
46  {
47  title = cmd->name;
48  }
49  else
50  {
51  title = cmd->syntax;
52  }
53 
54  Blam::Logger::LogEventForce("(" + title + ")", WSV_NONE);
56  }
57  else
58  {
59  return BlamResult::Success_OK;
60  }
61  }
62 
63  return BlamResult::Success_OK;
64  }
65  };
66 }
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:34
logger.h
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:31
Blam::Resources::Console::GetCommand
BLAM BlamConsoleCommand * GetCommand(std::string name)
Retrieves a command with the specified name.
Definition: console.cpp:233
Blam::Resources::Console::Halo2HelpCommand
Class for the h2help command.
Definition: h2help.hpp:18
Blam::Resources::Console::Halo2HelpCommand::Halo2HelpCommand
Halo2HelpCommand()
Definition: h2help.hpp:21
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:33
Blam::Resources::Console::Halo2HelpCommand::Execute
BlamResult Execute(std::vector< std::string > arguments)
Called upon command execution.
Definition: h2help.hpp:31
BlamConsoleCommand::syntax
std::string syntax
The syntax information for the command. Shown to the user when using the help command with an argumen...
Definition: console.h:35
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:38
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:262
BlamConsoleCommand::aliases
std::vector< std::string > aliases
A list of aliases for the command. Executing any of these instead of the command name will behave the...
Definition: console.h:36
Blam::Resources::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5