Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
help.hpp
Go to the documentation of this file.
1 #include "../console.h"
2 
3 #include <set>
4 
6 
8 {
17  {
18  public:
20  {
21  name = "help";
22  description = "Shows a list of commands.";
23 
25  }
26 
28  {
29  delete this;
30  }
31 
32  BlamCommandResult onCommand(std::vector<std::string> arguments)
33  {
34  using namespace Blam::Logger;
35 
36  // blank line
38 
39  std::set<std::string> command_list;
40 
41  std::map<std::string, BlamConsoleCommand*> map = Blam::Resources::Console::GetCommandList();
42  std::map<std::string, BlamConsoleCommand*>::iterator it;
43 
44  for (it = map.begin(); it != map.end(); it++)
45  {
46  command_list.insert(it->second->name);
47  }
48 
49  std::set<std::string>::iterator list_it;
50 
51  for (list_it = command_list.begin(); list_it != command_list.end(); list_it++)
52  {
53  std::string cmd_name = *list_it;
54 
56  }
57 
58  return CMD_OK;
59  }
60  };
61 }
command_list
std::map< std::string, BlamConsoleCommand * > command_list
The list of all loaded console commands.
Definition: console.cpp:41
Blam::Resources::Console::HelpCommand::HelpCommand
HelpCommand()
Definition: help.hpp:19
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:57
logger.h
Blam::Resources::Console::HelpCommand::~HelpCommand
~HelpCommand()
Definition: help.hpp:27
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:54
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message, BlamLogLevel severity)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:218
Blam::Resources::Console::HelpCommand::onCommand
BlamCommandResult onCommand(std::vector< std::string > arguments)
Called upon command execution.
Definition: help.hpp:32
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:56
WSV_NONE
#define WSV_NONE
Macro for 'None' log seveirty. Original pre-enum value was 0.
Definition: logger.h:16
Blam::Resources::Console::GetCommandList
BLAM std::map< std::string, BlamConsoleCommand * > GetCommandList()
Retrieves the list of all loaded console commands.
Definition: console.cpp:170
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:61
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.
CMD_OK
#define CMD_OK
Macro for OK command status. See #Blam::Resources::Console::Ok for more details.
Definition: console.h:8
BlamCommandResult
BlamCommandResult
Indicates the return state of a console command.
Definition: console.h:22
Blam::Logger
Namespace containing things related to the Blamite Logger.
Definition: logger.h:220
Blam::Resources::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
Blam::Resources::Console::HelpCommand
Class for the help command.
Definition: help.hpp:16