#include <script.h>
Inheritance diagram for hoa_script::GameScript:


Public Member Functions | |
| lua_State * | GetGlobalState () |
| Returns a pointer to the global lua state. | |
| void | HandleCastError (luabind::cast_failed &err) |
| Handles casting errors generated by Lua return values. | |
| void | HandleLuaError (luabind::error &err) |
| Handles run-time errors generated in Lua. | |
| bool | IsFileOpen (const std::string &filename) |
| Checks if a file is already in use by a ScriptDescriptor object. | |
| bool | SingletonInitialize () |
| A method for the inheriting class to implement, which initializes the class. | |
| ~GameScript () | |
Private Member Functions | |
| void | _AddOpenFile (ScriptDescriptor *sd) |
| Adds an open file to the list of open files. | |
| void | _RemoveOpenFile (ScriptDescriptor *sd) |
| Removes an open file from the list of open files. | |
| GameScript () | |
Private Attributes | |
| lua_State * | _global_state |
| The lua state shared globally by all files. | |
| std::map< std::string, ScriptDescriptor * > | _open_files |
| Maintains a list of all data files that are currently open. | |
Friends | |
| class | hoa_utils::Singleton< GameScript > |
| class | ModifyScriptDescriptor |
| class | ReadScriptDescriptor |
| class | ScriptDescriptor |
| class | WriteScriptDescriptor |
****************************************************************************
This class monitors all open script files and their descriptor objects. It maintains a global Lua state that all open Lua files use to communicate with each other and with the C++ engine.
Definition at line 194 of file script.h.
| hoa_script::GameScript::~GameScript | ( | ) |
Definition at line 54 of file script.cpp.
References _global_state, _open_files, and hoa_script::SCRIPT_DEBUG.
| hoa_script::GameScript::GameScript | ( | ) | [private] |
| void hoa_script::GameScript::_AddOpenFile | ( | ScriptDescriptor * | sd | ) | [private] |
Adds an open file to the list of open files.
Definition at line 87 of file script.cpp.
References hoa_script::ScriptDescriptor::_filename, and _open_files.
Referenced by hoa_script::ModifyScriptDescriptor::OpenFile().
| void hoa_script::GameScript::_RemoveOpenFile | ( | ScriptDescriptor * | sd | ) | [private] |
Removes an open file from the list of open files.
Definition at line 94 of file script.cpp.
References hoa_script::ScriptDescriptor::_filename, and _open_files.
Referenced by hoa_script::WriteScriptDescriptor::CloseFile(), hoa_script::ReadScriptDescriptor::CloseFile(), and hoa_script::ModifyScriptDescriptor::CloseFile().
| lua_State* hoa_script::GameScript::GetGlobalState | ( | ) | [inline] |
Returns a pointer to the global lua state.
Definition at line 206 of file script.h.
References _global_state.
Referenced by hoa_script::ModifyScriptDescriptor::OpenFile().
| void hoa_script::GameScript::HandleCastError | ( | luabind::cast_failed & | err | ) |
Handles casting errors generated by Lua return values.
| err | A reference to the luabind::cast_failed instance that was thrown |
Definition at line 80 of file script.cpp.
Referenced by hoa_global::GlobalCharacterGrowth::AcknowledgeGrowth(), and hoa_global::GlobalCharacter::GlobalCharacter().
| void hoa_script::GameScript::HandleLuaError | ( | luabind::error & | err | ) |
Handles run-time errors generated in Lua.
| err | A reference to the luabind::error instance that was thrown |
Definition at line 71 of file script.cpp.
Referenced by hoa_global::GlobalCharacterGrowth::AcknowledgeGrowth(), hoa_global::GlobalCharacter::GlobalCharacter(), and hoa_map::private_map::DialogueManager::Update().
| bool hoa_script::GameScript::IsFileOpen | ( | const std::string & | filename | ) |
Checks if a file is already in use by a ScriptDescriptor object.
| filename | The name of the file to check. |
Definition at line 101 of file script.cpp.
References _open_files.
Referenced by hoa_script::ModifyScriptDescriptor::OpenFile().
| bool hoa_script::GameScript::SingletonInitialize | ( | ) | [virtual] |
A method for the inheriting class to implement, which initializes the class.
Implements hoa_utils::Singleton< T >.
Definition at line 64 of file script.cpp.
Referenced by InitializeEngine().
friend class hoa_utils::Singleton< GameScript > [friend] |
friend class ModifyScriptDescriptor [friend] |
friend class ReadScriptDescriptor [friend] |
friend class ScriptDescriptor [friend] |
friend class WriteScriptDescriptor [friend] |
lua_State* hoa_script::GameScript::_global_state [private] |
The lua state shared globally by all files.
Definition at line 242 of file script.h.
Referenced by GameScript(), GetGlobalState(), and ~GameScript().
std::map<std::string, ScriptDescriptor*> hoa_script::GameScript::_open_files [private] |
Maintains a list of all data files that are currently open.
Definition at line 239 of file script.h.
Referenced by _AddOpenFile(), _RemoveOpenFile(), IsFileOpen(), and ~GameScript().
1.5.1