Changeset 8104 in orxonox.OLD for branches/script_engine/src/lib
- Timestamp:
- Jun 1, 2006, 10:12:43 PM (18 years ago)
- Location:
- branches/script_engine/src/lib/script_engine
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/script_engine/example.cc
r8103 r8104 28 28 const char Account::className[] = "Account"; 29 29 30 31 #define method(class, name) {#name, &class::name}32 33 30 Lunar<Account>::RegType Account::methods[] = { 34 31 {"deposit", new ExecutorLua1<Account, float>(&Account::deposit)}, … … 48 45 ~Object() { printf("deleted Object (%p)\n", this); } 49 46 50 //lua Interface51 //function that returns a value to lua52 int getCallCount(lua_State* L)53 {54 int calls = getCallCount();55 lua_pushnumber(L,(lua_Number)calls);56 return 1; // return number of values that the function wants to return to lua57 }58 59 //function that takes an argument from lua60 int takeParam(lua_State* L)61 {62 int param = (int)lua_tonumber(L,-1);63 takeParam(param);64 return 0;65 }66 67 //meber functions68 47 void takeParam(int i) 69 48 { -
branches/script_engine/src/lib/script_engine/lunartest2.lua
r8085 r8104 36 36 io.write("callCount is now ",callCount) 37 37 io.write("\n") 38 38 39 39 --pass parameters to a c++ method 40 40 Obj:takeParam(3) … … 51 51 52 52 return 2,false,2.72 53 53 54 --debug.debug() 54 55 end -
branches/script_engine/src/lib/script_engine/script.h
r8093 r8104 16 16 17 17 bool loadFile(std::string& filename); 18 std::string getFileName(){return currentFile;} 18 19 bool executeFile(); 19 20
Note: See TracChangeset
for help on using the changeset viewer.