HoverRace  2.0
Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
HoverRace::Client::HoverScript::SysEnv Class Reference

The global system environment. More...

#include <SysEnv.h>

+ Inheritance diagram for HoverRace::Client::HoverScript::SysEnv:

Public Member Functions

 SysEnv (Script::Core &scripting, DebugPeer &debugPeer, GamePeer &gamePeer, InputPeer &inputPeer)
 
virtual ~SysEnv ()
 
void RunScript (const Util::OS::path_t &filename)
 

Protected Member Functions

void InitEnv () override
 Initialize the environment in which scripts will run in. More...
 
virtual void LogError (const std::string &s)
 
virtual void LogInfo (const std::string &s)
 

Private Types

using SUPER = Script::Env
 

Private Attributes

DebugPeerdebugPeer
 
GamePeergamePeer
 
InputPeerinputPeer
 
Script::Core::OutHandle outHandle
 

Additional Inherited Members

- Private Member Functions inherited from HoverRace::Script::Env
 Env (Core &scripting)
 Constructor. More...
 
 Env (const Env &)=delete
 
virtual ~Env ()
 
Envoperator= (const Env &)=delete
 
bool RunScript (const Util::OS::path_t &filename)
 Execute a script from a file. More...
 
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...
 
CoreGetScripting () 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)
 
- Static Private Member Functions inherited from HoverRace::Script::Env
static Core::Chunk LoadChunkFromFile (const Util::OS::path_t &filename)
 Load a chunk from a file. More...
 

Detailed Description

The global system environment.

Author
Michael Imamura

Member Typedef Documentation

Constructor & Destructor Documentation

HoverRace::Client::HoverScript::SysEnv::SysEnv ( Script::Core scripting,
DebugPeer debugPeer,
GamePeer gamePeer,
InputPeer inputPeer 
)
HoverRace::Client::HoverScript::SysEnv::~SysEnv ( )
virtual

Member Function Documentation

void HoverRace::Client::HoverScript::SysEnv::InitEnv ( )
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.

void HoverRace::Client::HoverScript::SysEnv::LogError ( const std::string &  s)
protectedvirtual
void HoverRace::Client::HoverScript::SysEnv::LogInfo ( const std::string &  s)
protectedvirtual
void HoverRace::Client::HoverScript::SysEnv::RunScript ( const Util::OS::path_t filename)
inline

Member Data Documentation

DebugPeer& HoverRace::Client::HoverScript::SysEnv::debugPeer
private
GamePeer& HoverRace::Client::HoverScript::SysEnv::gamePeer
private
InputPeer& HoverRace::Client::HoverScript::SysEnv::inputPeer
private
Script::Core::OutHandle HoverRace::Client::HoverScript::SysEnv::outHandle
private

The documentation for this class was generated from the following files: