#include <LUAScriptHook.h>
Public Member Functions | |
| LUAScriptHook (LUAScriptFactory *factory, const std::string &hooksName, const std::string &directoryName) | |
| ~LUAScriptHook () | |
| void | addHookProvider (const std::string &hookName) |
| void | callHook (const std::string &hookName) |
| void | callHook (const std::string &hookName, const Param ¶m1) |
| void | callHook (const std::string &hookName, const Param ¶m1, const Param ¶m2) |
| void | callHook (const std::string &hookName, const Param ¶m1, const Param ¶m2, const Param ¶m3) |
| void | clearHooks () |
| bool | loadHooks () |
| void | listHooks () |
Protected Member Functions | |
| bool | loadHook (const std::string &directoryName, const std::string &fileName) |
| void | reloadHooks () |
| void | callHookInternal (const std::string &hookName, const std::vector< Param > ¶ms) |
Protected Attributes | |
| std::string | directoryName_ |
| std::string | hooksName_ |
| LUAScriptFactory * | factory_ |
| std::map < std::string, std::vector < HookEntry > > | hookNames_ |
Classes | |
| struct | HookEntry |
| class | Param |
Definition at line 29 of file LUAScriptHook.h.
| LUAScriptHook::LUAScriptHook | ( | LUAScriptFactory * | factory, | |
| const std::string & | hooksName, | |||
| const std::string & | directoryName | |||
| ) |
Definition at line 29 of file LUAScriptHook.cpp.
References clearHooks(), ConsoleUtil::formParams(), hooksName_, listHooks(), and reloadHooks().
| LUAScriptHook::~LUAScriptHook | ( | ) |
Definition at line 57 of file LUAScriptHook.cpp.
| void LUAScriptHook::addHookProvider | ( | const std::string & | hookName | ) |
Definition at line 61 of file LUAScriptHook.cpp.
References hookNames_.
Referenced by ServerChannelManager::ChannelEntry::ChannelEntry(), ServerNewGameState::ServerNewGameState(), ServerNextRoundState::ServerNextRoundState(), ServerPlayingState::ServerPlayingState(), and ServerShotFinishedState::ServerShotFinishedState().
| void LUAScriptHook::callHook | ( | const std::string & | hookName | ) |
Definition at line 68 of file LUAScriptHook.cpp.
References callHookInternal().
Referenced by ServerChannelManager::actualSend(), ServerPlayingState::enterState(), ServerNextRoundState::enterState(), ServerNewGameState::enterState(), and ServerShotFinishedState::scoreWinners().
| void LUAScriptHook::callHook | ( | const std::string & | hookName, | |
| const Param & | param1 | |||
| ) |
| void LUAScriptHook::callHook | ( | const std::string & | hookName, | |
| const Param & | param1, | |||
| const Param & | param2 | |||
| ) |
| void LUAScriptHook::callHook | ( | const std::string & | hookName, | |
| const Param & | param1, | |||
| const Param & | param2, | |||
| const Param & | param3 | |||
| ) |
| void LUAScriptHook::clearHooks | ( | ) |
Definition at line 150 of file LUAScriptHook.cpp.
References hookNames_, and LUAScriptHook::HookEntry::script.
Referenced by loadHooks(), and LUAScriptHook().
| bool LUAScriptHook::loadHooks | ( | ) |
Definition at line 169 of file LUAScriptHook.cpp.
References clearHooks(), directoryName_, FileList::getFiles(), and loadHook().
Referenced by reloadHooks().
| void LUAScriptHook::listHooks | ( | ) |
Definition at line 138 of file LUAScriptHook.cpp.
References S3D::formatStringBuffer(), hookNames_, and Logger::log().
Referenced by LUAScriptHook().
| bool LUAScriptHook::loadHook | ( | const std::string & | directoryName, | |
| const std::string & | fileName | |||
| ) | [protected] |
Definition at line 187 of file LUAScriptHook.cpp.
References LUAScriptFactory::createScript(), S3D::dialogMessage(), error(), factory_, file, S3D::formatStringBuffer(), LUAScript::functionExists(), XMLNode::getChildren(), XMLNode::getNamedChild(), XMLFile::getParserError(), XMLFile::getRootNode(), hookNames_, LUAScript::loadFromFile(), and XMLFile::readFile().
Referenced by loadHooks().
| void LUAScriptHook::reloadHooks | ( | ) | [inline, protected] |
Definition at line 86 of file LUAScriptHook.h.
References loadHooks().
Referenced by LUAScriptHook().
| void LUAScriptHook::callHookInternal | ( | const std::string & | hookName, | |
| const std::vector< Param > & | params | |||
| ) | [protected] |
Definition at line 100 of file LUAScriptHook.cpp.
References LUAScript::addBoolParameter(), LUAScript::addNumberParameter(), LUAScript::addStringParameter(), LUAScriptHook::Param::eBoolean, LUAScript::endFunction(), LUAScriptHook::Param::eNumber, hookNames_, and LUAScript::startFunction().
Referenced by callHook().
std::string LUAScriptHook::directoryName_ [protected] |
std::string LUAScriptHook::hooksName_ [protected] |
LUAScriptFactory* LUAScriptHook::factory_ [protected] |
std::map<std::string, std::vector<HookEntry> > LUAScriptHook::hookNames_ [protected] |
Definition at line 84 of file LUAScriptHook.h.
Referenced by addHookProvider(), callHookInternal(), clearHooks(), listHooks(), and loadHook().
1.5.3