HoverRace
2.0
|
Base class for debug consoles. More...
#include <Console.h>
Classes | |
class | LogStream |
class | LogStreamBuf |
Public Types | |
enum | InputState { InputState::COMMAND, InputState::CONTINUE } |
Public Member Functions | |
Console (Script::Core &scripting) | |
virtual | ~Console () |
virtual void | Advance (Util::OS::timestamp_t tick)=0 |
virtual void | Clear ()=0 |
Clear the console. More... | |
InputState | GetInputState () const |
void | SubmitChunk (const std::string &s) |
Submit a chunk to the script engine. More... | |
![]() | |
Env (Core &scripting) | |
Constructor. More... | |
Env (const Env &)=delete | |
virtual | ~Env () |
Env & | operator= (const Env &)=delete |
bool | RunScript (const Util::OS::path_t &filename) |
Execute a script from a file. More... | |
![]() | |
virtual void | HelpClass (const Class &cls)=0 |
virtual void | HelpMethod (const Class &cls, const Method &method)=0 |
Protected Member Functions | |
void | InitEnv () override |
Initialize the environment in which scripts will run in. More... | |
virtual void | LogError (const std::string &s)=0 |
virtual void | LogInfo (const std::string &s)=0 |
void | SetInputState (InputState newState) |
![]() | |
void | CopyGlobals () |
Copy the global environment into the current table at the top of the stack. More... | |
template<class ReturnPolicy = Core::PrintReturn> | |
int | Execute (const Core::Chunk &chunk, ReturnPolicy rp=ReturnPolicy()) |
Execute a chunk of code in the current environment. More... | |
Core & | GetScripting () const |
lua_State * | GetState () const |
void | LogScriptError (const Script::ScriptExn &ex) |
void | PushEnv () |
Push the environment onto the stack. More... | |
void | SetHelpHandler (Help::HelpHandler *helpHandler) |
Private Types | |
using | SUPER = Script::Env |
Static Private Member Functions | |
static int | LClear (lua_State *state) |
Private Attributes | |
std::string | chunk |
InputState | inputState |
Script::Core::OutHandle | outHandle |
Additional Inherited Members | |
![]() | |
static Core::Chunk | LoadChunkFromFile (const Util::OS::path_t &filename) |
Load a chunk from a file. More... | |
Base class for debug consoles.
|
private |
HoverRace::Client::HoverScript::Console::Console | ( | Script::Core & | scripting | ) |
|
virtual |
|
pure virtual |
Implemented in HoverRace::Client::HoverScript::SysConsole.
|
pure virtual |
Clear the console.
Implemented in HoverRace::Client::HoverScript::SysConsole.
Console::InputState HoverRace::Client::HoverScript::Console::GetInputState | ( | ) | const |
|
overrideprotectedvirtual |
Initialize the environment in which scripts will run in.
Upon entry, the Lua stack will have at least one entry, the table which represents the environment. Implementing functions will fill this table with the globals which will be available to the functions which are run in this environment. Upon return, this same table must be at the top of the stack.
Implements HoverRace::Script::Env.
Reimplemented in HoverRace::Client::HoverScript::SysConsole.
|
staticprivate |
|
protectedpure virtual |
Implemented in HoverRace::Client::HoverScript::SysConsole.
|
protectedpure virtual |
Implemented in HoverRace::Client::HoverScript::SysConsole.
|
protected |
void HoverRace::Client::HoverScript::Console::SubmitChunk | ( | const std::string & | s | ) |
Submit a chunk to the script engine.
s | The chunk. |
|
private |
|
private |
|
private |