|
| DebugConsole () |
|
| DebugConsole (Game *_game) |
|
void | run_command (std::string input) |
|
std::string | get_message () |
|
std::string | input_from_buffer (int direction) |
|
void | help (std::vector< std::string > command, std::vector< int > args) |
|
void | list (std::vector< std::string > command, std::vector< int > args) |
|
void | killall (std::vector< std::string > command, std::vector< int > args) |
|
void | spawn (std::vector< std::string > command, std::vector< int > args) |
|
void | teleport (std::vector< std::string > command, std::vector< int > args) |
|
DebugConsole::DebugConsole |
( |
| ) |
|
DebugConsole::DebugConsole |
( |
Game * |
_game | ) |
|
Constructor for DebugConsole.
- Parameters
-
_game | Sets the game member object to _game. |
std::string DebugConsole::get_message |
( |
| ) |
|
Accessor for the member variable debug_message.
- Returns
- Member variable debug_message.
void DebugConsole::help |
( |
std::vector< std::string > |
command, |
|
|
std::vector< int > |
args |
|
) |
| |
Brings up the help menu.
- Parameters
-
command | The list of string arguments for the function. |
args | The list of int arguments for the function. |
std::string DebugConsole::input_from_buffer |
( |
int |
direction | ) |
|
Returns somewhere in the buffer. Takes in a number, and changes current_place by that value.
- Parameters
-
direction | The direction to move in the buffer. |
- Returns
- The string at that location in the buffer.
void DebugConsole::killall |
( |
std::vector< std::string > |
command, |
|
|
std::vector< int > |
args |
|
) |
| |
Kills everything in game.enemy_list.
- Parameters
-
command | The list of string arguments for the function. |
args | The list of int arguments for the function. |
void DebugConsole::list |
( |
std::vector< std::string > |
command, |
|
|
std::vector< int > |
args |
|
) |
| |
Lists something (i.e. your coordinates).
- Parameters
-
command | The list of string arguments for the function. |
args | The list of int arguments for the function. |
void DebugConsole::run_command |
( |
std::string |
input | ) |
|
Runs a command based on input. Takes in a string, processes it, and runs the command. The string includes the space separated arguments.
- Parameters
-
command | The command to run. |
void DebugConsole::spawn |
( |
std::vector< std::string > |
command, |
|
|
std::vector< int > |
args |
|
) |
| |
Spawns enemies.
- Parameters
-
command | The list of string arguments for the function. |
args | The list of int arguments for the function. |
void DebugConsole::teleport |
( |
std::vector< std::string > |
command, |
|
|
std::vector< int > |
args |
|
) |
| |
Teleports the main character.
- Parameters
-
command | The list of string arguments for the function. |
args | The list of int arguments for the function. |
std::vector<std::string> DebugConsole::buffer |
|
private |
A buffer to hold the previous commands which have been input.
int DebugConsole::buffer_place |
|
private |
An index of where the most recent command is in the buffer.
int DebugConsole::buffer_size |
|
private |
The maximum size of the buffer.
int DebugConsole::current_place |
|
private |
The current place that we are in the buffer.
std::string DebugConsole::debug_message |
|
private |
The message to show the player.
std::map<std::string, function> DebugConsole::func_map |
|
private |
A hashmap to make the functions directly callable. This allows the functions to be called directly by name instead of needing to use an if else or switch case.
An instance of the game so the console can do things.
The documentation for this class was generated from the following files:
- src/misc_classes/debug.h
- src/misc_classes/debug.cpp