/** * \brief Checks that the userdata at the specified index of the stack is a * timer and returns it. * \param l a Lua context * \param index an index in the stack * \return the timer */ Timer& LuaContext::check_timer(lua_State* l, int index) { return static_cast<Timer&>(check_userdata(l, index, timer_module_name)); }
/** * \brief Checks that the userdata at the specified index of the stack is a * timer and returns it. * \param l a Lua context * \param index an index in the stack * \return the timer */ TimerPtr LuaContext::check_timer(lua_State* l, int index) { return std::static_pointer_cast<Timer>( check_userdata(l, index, timer_module_name) ); }
/** * \brief Checks that the userdata at the specified index of the stack is a * text surface and returns it. * \param l a Lua context * \param index an index in the stack * \return the text surface */ std::shared_ptr<TextSurface> LuaContext::check_text_surface(lua_State* l, int index) { return std::static_pointer_cast<TextSurface>(check_userdata( l, index, text_surface_module_name )); }
/** * \brief Checks that the userdata at the specified index of the stack is a * text surface and returns it. * \param l a Lua context * \param index an index in the stack * \return the text surface */ TextSurface& LuaContext::check_text_surface(lua_State* l, int index) { return static_cast<TextSurface&>( check_userdata(l, index, text_surface_module_name)); }
/** * \brief Checks that the userdata at the specified index of the stack is a * surface and returns it. * \param l a Lua context * \param index an index in the stack * \return the surface */ SurfacePtr LuaContext::check_surface(lua_State* l, int index) { return std::static_pointer_cast<Surface>(check_userdata( l, index, surface_module_name )); }
/** * \brief Checks that the userdata at the specified index of the stack is an * equipment item and returns it. * \param l A Lua context. * \param index An index in the stack. * \return The equipment item. */ EquipmentItem& LuaContext::check_item(lua_State* l, int index) { return static_cast<EquipmentItem&>(check_userdata(l, index, item_module_name)); }
static void cfTreeGetId(void) { lua_pushnumber(IupTreeGetId(iuplua_checkihandle(1), check_userdata(2))); }
static void cfTreeSetUserId(void) { lua_pushnumber(IupTreeSetUserId(iuplua_checkihandle(1), luaL_check_int(2), check_userdata(3))); }
/** * \brief Checks that the userdata at the specified index of the stack is a * game and returns it. * \param l a Lua context * \param index an index in the stack * \return the game */ Savegame& LuaContext::check_game(lua_State* l, int index) { return static_cast<Savegame&>(check_userdata(l, index, game_module_name)); }