Blamite Game Engine - blam!  00285.12.18.20.1411.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 
6 namespace Blam::Console
7 {
13  class QuitCommand : public ConsoleCommand
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  CommandStatus onCommand(std::vector<std::string> arguments)
31  {
32  SendMessage(Blam::GetWin32MainWindowHandle(), WM_QUIT, NULL, NULL);
33 
34  return CommandStatus::Ok;
35  }
36  };
37 }
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:78
Blam::Console::ConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:76
Blam::Console::ConsoleCommand::type
CommandType type
The type of command this is. See Blam::Console::CommandType for more information.
Definition: console.h:80
Blam::Console::CommandStatus
CommandStatus
Indicates the return state of a console command.
Definition: console.h:31
logger.h
Blam::GetWin32MainWindowHandle
BLAM HWND GetWin32MainWindowHandle()
Retrieves the main window handle of the application.
Definition: main.cpp:728
Blam::Console::Builtin
@ Builtin
A command that is hard-coded into the engine.
Definition: console.h:44
Blam::Console::ConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:73
Blam::Console::QuitCommand
Class for the quit command.
Definition: quit.hpp:13
Blam::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
Blam::Console::QuitCommand::QuitCommand
QuitCommand()
Definition: quit.hpp:16
Blam::Console::QuitCommand::~QuitCommand
~QuitCommand()
Definition: quit.hpp:25
Blam::Console::ConsoleCommand
Class used to represent a console command.
Definition: console.h:53
core.h
Blam::Console::QuitCommand::onCommand
CommandStatus onCommand(std::vector< std::string > arguments)
Called upon command execution.
Definition: quit.hpp:30
Blam::Globals::Ok
@ Ok
The global was updated successfully.
Definition: globals.h:224