Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.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
37  LogEventForce("", WSV_NONE);
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 
55  Blam::Logger::LogEventForce(cmd_name, WSV_NONE);
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:48
Blam::Resources::Console::HelpCommand::HelpCommand
HelpCommand()
Definition: help.hpp:19
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:59
logger.h
Blam::Resources::Console::HelpCommand::~HelpCommand
~HelpCommand()
Definition: help.hpp:27
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:56
BlamCommandResult
BlamCommandResult
Indicates the return state of a console command.
Definition: console.h:22
CMD_OK
#define CMD_OK
Macro for OK command status. See #Blam::Resources::Console::Ok for more details.
Definition: console.h:8
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:58
it
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause it
Definition: ARPHICPL.TXT:36
Blam::Resources::Console::GetCommandList
BLAM std::map< std::string, BlamConsoleCommand * > GetCommandList()
Retrieves the list of all loaded console commands.
Definition: console.cpp:237
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:63
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:274
Blam::Logger
Namespace containing things related to the Blamite Logger.
Definition: logger.h:200
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