Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2017, 4:04:14 PM (7 years ago)
Author:
kohlia
Message:

The ScriptableController should work now. A demo level called scriptableControllerTest exists as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/luatb.h

    r11549 r11673  
    66struct lua_State;
    77
    8 // Makes certain functions visible to lua while staying type-safe on the
    9 // C++ side.
     8/**
     9 * @brief Makes certain functions visible to lua while staying type-safe
     10 * on the C++ side.
     11 */
    1012template<typename ThisType, typename FunctionType>
    1113class LuaTB
    1214{
    1315public:
    14     // Make a function visible to lua. If you want to make a function 'foo'
    15     // visible, you should call it like this:
    16     //
    17     // LuaTB<decltype(foo)>::registerFunction<foo>( ... );
     16    /**
     17     * @brief Make a function visible to lua
     18     * @param _this Pointer to the object that owns the function
     19     * @param lua Pointer to the lua state
     20     * @param name Name that will be visible to lua for this function
     21     *
     22     * Only class functions are supported, because that's  all we need at
     23     * the moment. Extending it to support normal functions as well should
     24     * be fairly easy, though.
     25     *
     26     * If you want to make a function 'Foo::bar' visible, you should call
     27     * it like this (assuming no C++17 support):
     28     *
     29     * LuaTB<Foo, decltype(&Foo::bar)>::registerFunction<&Foo::bar>( ... );
     30     */
    1831    template<FunctionType func>
    1932    static void registerFunction(ThisType *_this, lua_State *lua, std::string name);
     
    2134
    2235// We need to include all type-dependant template implementations, because the
    23 // compiler needs to know for which types it has to instantiate those
     36// compiler needs to know for which types it has to instantiate those.
    2437#include "luatb.ipp"
    2538
Note: See TracChangeset for help on using the changeset viewer.