summaryrefslogtreecommitdiff
path: root/src/luascript.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-12-26 19:53:20 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2018-12-26 19:53:20 +0100
commit41c30cdf376730a68fcda69b57b1139f143a5543 (patch)
treea109688cfa7d7a946d6a5268e484e220ed994af5 /src/luascript.h
parent1d1b1e025087fc99702beb14d70ead9291ed6470 (diff)
Fix indentation and code-style.
Diffstat (limited to 'src/luascript.h')
-rw-r--r--src/luascript.h66
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__*/