Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
quit.hpp
Go to the documentation of this file.
1 #include "../console.h"
2 
4 #include "core.h"
5 
7 {
14  {
15  public:
17  {
18  name = "quit";
19  description = "Quits the game.";
20  aliases = { "exit", "qqq" };
21 
23  }
24 
26  {
27  delete this;
28  }
29 
30  BlamCommandResult onCommand(std::vector<std::string> arguments)
31  {
32  SendMessage(Blam::GetWin32MainWindowHandle(), WM_QUIT, NULL, NULL);
33 
34  return BlamCommandResult::Ok;
35  }
36  };
37 }
Blam::Resources::Console::QuitCommand::onCommand
BlamCommandResult onCommand(std::vector< std::string > arguments)
Called upon command execution.
Definition: quit.hpp:30
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:57
Blam::Resources::Console::QuitCommand::QuitCommand
QuitCommand()
Definition: quit.hpp:16
logger.h
BlamCommandResult::Ok
@ Ok
The command was run without error.
Blam::GetWin32MainWindowHandle
BLAM HWND GetWin32MainWindowHandle()
Retrieves the main window handle of the application.
Definition: main.cpp:745
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:54
Blam::Resources::Console::QuitCommand
Class for the quit command.
Definition: quit.hpp:13
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:56
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:61
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.
core.h
BlamCommandResult
BlamCommandResult
Indicates the return state of a console command.
Definition: console.h:22
Blam::Resources::Console::QuitCommand::~QuitCommand
~QuitCommand()
Definition: quit.hpp:25
BlamConsoleCommand::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:59
Blam::Resources::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5