Blamite Game Engine - Blam (Core)
list_colors.hpp
Go to the documentation of this file.
1 #include "../console.h"
4 
5 namespace Blam::Console
6 {
13  {
14  public:
16  {
17  name = "list_colors";
18  description = "List all available colors for the print command.";
19  aliases = { "listcolors" };
20 
22  }
23 
25  {
26  delete this;
27  }
28 
29  CommandStatus onCommand(std::vector<std::string> arguments)
30  {
31  std::map<std::string, BlamColor>::iterator it;
32 
33  for (it = InternalUI::Colors::GetColorList()->begin(); it != InternalUI::Colors::GetColorList()->end(); it++)
34  {
35  Blam::Logger::LogEvent(it->first, it->second);
36  }
37 
38  return CommandStatus::Ok;
39  }
40  };
41 }
Blam::Console::ConsoleCommand::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:75
Blam::Console::ConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:73
Blam::Console::ConsoleCommand::type
CommandType type
The type of command this is. See Blam::Console::CommandType for more information.
Definition: console.h:77
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:33
Blam::Console::CommandStatus
CommandStatus
Indicates the return state of a console command.
Definition: console.h:28
logger.h
debug_colors.h
Blam::Console::Builtin
@ Builtin
A command that is hard-coded into the engine.
Definition: console.h:41
Blam::Console::ConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:70
Blam::Console::ListColorsCommand::ListColorsCommand
ListColorsCommand()
Definition: list_colors.hpp:15
InternalUI::Colors::GetColorList
BLAM std::map< std::string, BlamColor > * GetColorList()
Retrieves the list of colors known to the engine.
Definition: debug_ui_colors.cpp:22
Blam::Console::ListColorsCommand::onCommand
CommandStatus onCommand(std::vector< std::string > arguments)
Called upon command execution.
Definition: list_colors.hpp:29
Blam::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
Blam::Console::Ok
@ Ok
The command was run without error.
Definition: console.h:30
Blam::Console::ConsoleCommand
Class used to represent a console command.
Definition: console.h:50
Blam::Console::ListColorsCommand
Class for the list_colors command.
Definition: list_colors.hpp:12
Blam::Console::ListColorsCommand::~ListColorsCommand
~ListColorsCommand()
Definition: list_colors.hpp:24