Blamite Game Engine - Blam (Core)
h2print.hpp
Go to the documentation of this file.
1 #include "../console.h"
3 
4 namespace Blam::Console
5 {
14  {
15  public:
17  {
18  name = "h2print";
19  description = "Prints a message to the screen. Only one word is supported, and no color overrides are present.";
20  aliases = { "cprint" };
21 
23  }
24 
26  {
27  delete this;
28  }
29 
30  CommandStatus onCommand(std::vector<std::string> arguments)
31  {
32  using namespace Blam::Logger;
33 
34  if (arguments.size() != 1)
35  {
37  }
38  else
39  {
40  BlamColor color;
41  color.r = 0;
42  color.g = 255;
43  color.b = 0;
44 
45  LogEventForce(Blam::Utils::String::ToLower(arguments[0]), color);
46 
47  return CMD_OK;
48  }
49  }
50  };
51 }
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
CMD_ERR_WRONG_ARGS_COUNT
#define CMD_ERR_WRONG_ARGS_COUNT
Macro for Wrong Arg Count command status. See Blam::Console::WrongArgumentCount for more details.
Definition: console.h:11
Blam::Console::Halo2PrintCommand
Class for the h2print command.
Definition: h2print.hpp:13
Blam::Console::ConsoleCommand::type
CommandType type
The type of command this is. See Blam::Console::CommandType for more information.
Definition: console.h:77
Blam::Utils::String::ToLower
BLAM std::string ToLower(std::string string)
Transforms a string to all-lowercase.
Definition: string.cpp:49
Blam::Console::CommandStatus
CommandStatus
Indicates the return state of a console command.
Definition: console.h:28
Blam::Console::Halo2PrintCommand::~Halo2PrintCommand
~Halo2PrintCommand()
Definition: h2print.hpp:25
logger.h
BlamColor::g
short g
The Green value of the color.
Definition: colors.h:22
Blam::Console::Halo2PrintCommand::Halo2PrintCommand
Halo2PrintCommand()
Definition: h2print.hpp:16
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
BlamColor::r
short r
The Red value of the color.
Definition: colors.h:21
BlamColor::b
short b
The Blue value of the color.
Definition: colors.h:23
Blam::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
Blam::Console::Halo2PrintCommand::onCommand
CommandStatus onCommand(std::vector< std::string > arguments)
Called upon command execution.
Definition: h2print.hpp:30
Blam::Console::ConsoleCommand
Class used to represent a console command.
Definition: console.h:50
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message, LogSeverity severity)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:137
CMD_OK
#define CMD_OK
Macro for OK command status. See Blam::Console::Ok for more details.
Definition: console.h:9
Blam::Logger
Namespace containing things related to the Blamite Logger.
Definition: logger.h:44
BlamColor
Structure representing a color.
Definition: colors.h:18