diff options
Diffstat (limited to 'src/luascript.h')
-rw-r--r-- | src/luascript.h | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/luascript.h b/src/luascript.h index 93478df..c7ea9b7 100644 --- a/src/luascript.h +++ b/src/luascript.h @@ -25,8 +25,7 @@ * along with Pracro; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __PRACRO_LUASCRIPT_H__ -#define __PRACRO_LUASCRIPT_H__ +#pragma once #include <lua.hpp> #include <lauxlib.h> @@ -40,54 +39,55 @@ #include <QThread> -class LUAScript : public QThread { -Q_OBJECT +class LUAScript + : public QThread +{ + Q_OBJECT public: - class Exception { - public: - Exception(std::string m) : msg(m) {} - std::string msg; - }; + class Exception + { + public: + Exception(std::string m) : msg(m) {} + std::string msg; + }; - LUAScript(OutputWindow *out, QString file); - ~LUAScript(); + LUAScript(OutputWindow *out, QString file); + ~LUAScript(); - void init() throw(Exception); - void cleanup(); + void init(); + void cleanup(); - void run(); - void runScript() throw(Exception); + void run(); + void runScript(); - OutputWindow *out; + OutputWindow *out; - void lineChange(int lineno); + void lineChange(int lineno); - void playSound(QString file); + void playSound(QString file); + void sleep(int n); - volatile bool lua_stop; - volatile bool lua_stopped; - QString file; + volatile bool lua_stop; + volatile bool lua_stopped; + QString file; public slots: - void stopScript(); + void stopScript(); signals: - void reset(); - void lineChanged(int lineno); + void reset(); + void lineChanged(int lineno); protected: - lua_State *L; + lua_State *L; private: - std::vector<std::pair<std::string, std::string> > scripts; - std::map<std::string, std::string> values; + std::vector<std::pair<std::string, std::string> > scripts; + std::map<std::string, std::string> values; - int top; + int top; - bool running; + bool running; - SoundPlayer player; + SoundPlayer player; }; - - -#endif/*__PRACRO_LUASCRIPT_H__*/ |