Changeset 11549 for code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
- Timestamp:
- Nov 6, 2017, 5:23:08 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.cc
r11519 r11549 9 9 { 10 10 11 ScriptableControllerAPI *ScriptableControllerAPI::this_;12 13 11 ScriptableControllerAPI::ScriptableControllerAPI(lua_State *lua, ScriptableController *controller) 14 12 { 15 13 this->lua_ = lua; 16 14 this->controller_ = controller; 17 ScriptableControllerAPI::this_ = this;18 15 19 16 // Haven't found a shorter way yet to write that... 20 LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::testOutput)>::registerFunction<&ScriptableControllerAPI::testOutput>(this, lua, "testOutput");21 17 LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAfterTimeout)>::registerFunction<&ScriptableControllerAPI::registerAfterTimeout>(this, lua, "registerAfterTimeout"); 22 18 LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtNearObject)>::registerFunction<&ScriptableControllerAPI::registerAtNearObject>(this, lua, "registerAtNearObject"); … … 32 28 } 33 29 34 void ScriptableControllerAPI:: testOutput()30 void ScriptableControllerAPI::registerAfterTimeout(std::function<void (void)> callback, double timeout) 35 31 { 36 orxout(user_info) << "Wheee!!!" << std::endl; 37 } 38 39 void ScriptableControllerAPI::registerAfterTimeout(std::function<void (void)> callback, int timeout_ms) 40 { 41 32 this->controller_->registerTimeout(callback, timeout); 42 33 } 43 34 44 35 int ScriptableControllerAPI::registerAtNearObject(std::function<void (int, int)> callback, int obj1, int obj2, double distance) 45 36 { 46 37 orxout(user_warning) << "Working!" << std::endl; 47 38 } 48 39
Note: See TracChangeset
for help on using the changeset viewer.