Last change
on this file since 8252 was
8061,
checked in by bensch, 18 years ago
|
merged the scriptengine back to the trunk
|
File size:
1.2 KB
|
Line | |
---|
1 | #ifndef _SCRIPT_H |
---|
2 | #define _SCRIPT_H |
---|
3 | |
---|
4 | |
---|
5 | #include <string> |
---|
6 | #include "base_object.h" |
---|
7 | |
---|
8 | #include "luaincl.h" |
---|
9 | |
---|
10 | |
---|
11 | class Script |
---|
12 | { |
---|
13 | public: |
---|
14 | Script(); |
---|
15 | ~Script(); |
---|
16 | |
---|
17 | bool loadFile(std::string& filename); |
---|
18 | bool executeFile(); |
---|
19 | |
---|
20 | lua_State* getLuaState() const{return luaState;} |
---|
21 | |
---|
22 | bool selectFunction(std::string& functionName, int retCount); |
---|
23 | bool executeFunction(); |
---|
24 | bool pushParam(int param, std::string& toFunction);//overload this function to add different types |
---|
25 | bool pushParam(float param, std::string& toFunction); |
---|
26 | bool pushParam(double param, std::string& toFunction); |
---|
27 | int getReturnedInt(); |
---|
28 | |
---|
29 | |
---|
30 | |
---|
31 | private: |
---|
32 | |
---|
33 | int reportError(int error); |
---|
34 | |
---|
35 | lua_State* luaState; //!< The lua_State that the Script works on |
---|
36 | std::string currentFile; //!< The file that is loaded in the script |
---|
37 | std::string currentFunction; //!< The name of the current active function (the one that gets the pushed parameter) |
---|
38 | int argumentCount; //!< Number of arguments for the current function |
---|
39 | int returnCount; //!< Number of return values of the current function |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | }; |
---|
45 | #endif /* _SCRIPT_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.