Changeset 8104 in orxonox.OLD for branches/script_engine/src/lib/script_engine/example.cc
- Timestamp:
- Jun 1, 2006, 10:12:43 PM (18 years ago)
- File:
-
- 1 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 {
Note: See TracChangeset
for help on using the changeset viewer.