Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
abort.hpp
Go to the documentation of this file.
1 #include "../console.h"
4 
6 {
13  {
14  public:
16  {
17  name = "abort";
18  description = "Aborts the engine using abort() function. Requires CONFIRM argument to execute.";
19 
21  }
22 
23  BlamResult Execute(std::vector<std::string> arguments)
24  {
25  if (arguments.size() > 1)
26  {
27  return BlamResult::Error_Command_WrongArgumentCount;
28  }
29 
30  if (arguments.size() == 0)
31  {
32  Blam::Logger::LogEventForce("this command will abort engine runtime", WSV_ERROR);
33  Blam::Logger::LogEventForce("if you are sure please run: abort CONFIRM", WSV_ERROR);
34 
35  return BlamResult::Success_OK;
36  }
37 
38  if (arguments[0] == "CONFIRM")
39  {
40  abort();
41  }
42  else
43  {
44  return BlamResult::Error_Command_InvalidArguments;
45  }
46 
47  return BlamResult::Success_OK;
48  }
49  };
50 }
Blam::Resources::Console::AbortCommand::AbortCommand
AbortCommand()
Definition: abort.hpp:15
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:34
logger.h
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:31
Blam::Resources::Console::AbortCommand::Execute
BlamResult Execute(std::vector< std::string > arguments)
Called upon command execution.
Definition: abort.hpp:23
Blam::Resources::Console::AbortCommand
Class for the abort command.
Definition: abort.hpp:12
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:33
crash.h
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:38
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