Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
print.hpp
Go to the documentation of this file.
1 #include "../console.h"
2 
4 
6 {
19  {
20  public:
22  {
23  name = "print";
24  description = "Prints a message to the screen. Supports color arguments";
25 
27  }
28 
29  BlamResult Execute(std::vector<std::string> arguments)
30  {
31  if (arguments.size() == 0)
32  {
33  return BlamResult::Error_Command_WrongArgumentCount;
34  }
35 
36  std::string message_text = "";
37 
38  for (int i = 0; i < arguments.size(); i++)
39  {
40  if (i == arguments.size() - 1)
41  {
42  message_text += arguments[i];
43  }
44  else
45  {
46  message_text += arguments[i] + " ";
47  }
48  }
49 
50  Blam::Logger::LogEventForce(message_text, BlamColor(0, 255, 0));
51 
52  return BlamResult::Success_OK;
53  }
54  };
55 }
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:36
logger.h
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:33
Blam::Resources::Console::PrintCommand::Execute
BlamResult Execute(std::vector< std::string > arguments)
Called upon command execution.
Definition: print.hpp:29
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:35
Blam::Resources::Console::PrintCommand
Class for the print command.
Definition: print.hpp:18
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:40
Blam::Resources::Console::PrintCommand::PrintCommand
PrintCommand()
Definition: print.hpp:21
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:262
Blam::Resources::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.