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