Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 6, 2017, 5:23:08 PM (7 years ago)
Author:
kohlia
Message:

Not working yet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.cc

    r11519 r11549  
    99{
    1010
    11 ScriptableControllerAPI *ScriptableControllerAPI::this_;
    12 
    1311ScriptableControllerAPI::ScriptableControllerAPI(lua_State *lua, ScriptableController *controller)
    1412{
    1513    this->lua_ = lua;
    1614    this->controller_ = controller;
    17     ScriptableControllerAPI::this_ = this;
    1815
    1916    // Haven't found a shorter way yet to write that...
    20     LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::testOutput)>::registerFunction<&ScriptableControllerAPI::testOutput>(this, lua, "testOutput");
    2117    LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAfterTimeout)>::registerFunction<&ScriptableControllerAPI::registerAfterTimeout>(this, lua, "registerAfterTimeout");
    2218    LuaTB<ScriptableControllerAPI, decltype(&ScriptableControllerAPI::registerAtNearObject)>::registerFunction<&ScriptableControllerAPI::registerAtNearObject>(this, lua, "registerAtNearObject");
     
    3228}
    3329
    34 void ScriptableControllerAPI::testOutput()
     30void ScriptableControllerAPI::registerAfterTimeout(std::function<void (void)> callback, double timeout)
    3531{
    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);
    4233}
    4334
    4435int ScriptableControllerAPI::registerAtNearObject(std::function<void (int, int)> callback, int obj1, int obj2, double distance)
    4536{
    46 
     37    orxout(user_warning) << "Working!" << std::endl;
    4738}
    4839
Note: See TracChangeset for help on using the changeset viewer.