Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/script_engine/src/lib/script_engine/Script.h @ 8044

Last change on this file since 8044 was 8044, checked in by snellen, 18 years ago

calling scriptfunctions from c++ works now (includeing adding parameters)

File size: 1.0 KB
RevLine 
[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
11class 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
[8032]22    void selectFunction(std::string& functionName, int retCount);
[8044]23    void  executeFunction(); //return number of returned values
[8032]24    bool pushParam(int param, std::string& toFunction);//overload this function to add different types
25    bool pushParam(float param, std::string& toFunction);
[7975]26
[8021]27
28
[8044]29
[7975]30  private:
31
[8044]32    int reportError(int error);
33
[8032]34    lua_State*         luaState;         //!< The lua_State that the Script works on
35    std::string        currentFunction;  //!< The name of the current active function (the one that gets the pushed parameter)
36    int                argumentCount;    //!< Number of arguments for the current function
37    int                returnCount;      //!< Number of return values of the current function
[7975]38
39
40
41
42};
[8032]43#endif /* _SCRIPT_H */
Note: See TracBrowser for help on using the repository browser.