MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / register_script

Method register_script

ogsr_engine/COMMON_AI/object_factory_script.cpp:51–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49{};
50
51void CObjectFactory::register_script() const
52{
53 actualize();
54
55 luabind::class_<CInternal> instance("clsid");
56
57 const_iterator I = clsids().begin(), B = I;
58 const_iterator E = clsids().end();
59 for (; I != E; ++I)
60 instance = std::move(instance).enum_("_clsid")[luabind::value(*(*I)->script_clsid(), int(I - B))];
61
62 lua_State* L = ai().script_engine().lua();
63 luabind::module(L)[std::move(instance)]; // это представление нельзя обработать как таблицу
64
65 lua_newtable(L);
66 I = B;
67 for (; I != E; ++I)
68 {
69 lua_pushinteger(L, int(I - B));
70 lua_setfield(L, -2, *(*I)->script_clsid());
71 }
72 lua_setglobal(L, "clsid_table"); // это представление можно обработать как таблицу :)
73}
74
75
76void CObjectFactory::script_register(lua_State* L)

Callers 1

initMethod · 0.80

Calls 8

valueClass · 0.85
moduleFunction · 0.85
enum_Method · 0.80
lua_pushintegerFunction · 0.50
lua_setfieldFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
script_clsidMethod · 0.45

Tested by

no test coverage detected