{"id":197300,"date":"2013-10-12T22:47:03","date_gmt":"2013-10-12T18:47:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=197300"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=197300","title":{"rendered":"<span class=\"post_title\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Lua \u0438 C++ \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041a\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/EliasD\/unnamed_lua_binder\">\u0437\u0434\u0435\u0441\u044c<\/a>.  <\/p>\n<h5>\u0427\u0435\u043c \u0442\u0430\u043a \u0445\u043e\u0440\u043e\u0448 Lua?<\/h5>\n<p>  \u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u0441\u0432\u043e\u044e \u0438\u0433\u0440\u0443 \u0438 \u0437\u0430\u0434\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c: \u0430 \u043a\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<br \/>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b: \u043e\u0434\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <a href=\"http:\/\/www.json.org\/\">JSON<\/a>, \u0434\u0440\u0443\u0433\u0438\u0435 \u2014 XML, \u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0443 \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 .txt \u0444\u0430\u0439\u043b\u0430\u0445 \u0438\u043b\u0438 \u043f\u0438\u0448\u0443\u0442 \u0441\u0432\u043e\u0438 \u043f\u0430\u0440\u0441\u0435\u0440\u044b. \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 Lua.<\/p>\n<p>  Lua \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0438\u0433\u0440, \u043d\u043e \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0430\u0439\u043b\u0430\u0445. <\/p>\n<p>  \u0412\u043e\u0442, \u0447\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 Lua \u043d\u0430 \u0444\u043e\u043d\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432:  <\/p>\n<ul>\n<li>Lua \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u043a\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Lua \u0438 \u0442\u0440\u0451\u0445 .h \u0444\u0430\u0439\u043b\u043e\u0432).<\/li>\n<li>\u0412 Lua \u0444\u0430\u0439\u043b\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 Lua. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/> \n<pre><code class=\"lua\">some_variable = math.sqrt(2) * 2 some_variable2 = 64 * 16 - 32 <\/code><\/pre>\n<p>  <\/li>\n<li>Lua \u2014 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u044f\u0437\u044b\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438.<\/li>\n<li>\u0423 Lua <a href=\"http:\/\/www.lua.org\/license.html\">\u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f MIT<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043a\u0430\u043a \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043f\u0440\u0438\u0447\u0451\u043c \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0439 \u0432\u043e\u0437\u043d\u0438 \u0441 \u0431\u0443\u043c\u0430\u0433\u0430\u043c\u0438. \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435: \u00ab\u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c\u00bb.<\/li>\n<li>Lua \u043a\u043e\u043c\u043f\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0437\u0434\u0435, \u0442.\u043a. \u043e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c C \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/li>\n<li>\u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u043c \u0433\u043b\u0430\u0437\u0443 \u0432\u0438\u0434\u0435. \u0418\u0445 \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435.<\/li>\n<\/ul>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u044f \u043f\u0435\u0440\u0435\u0439\u0434\u0443 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u0440<\/h5>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b <b>Player.lua<\/b>  <\/p>\n<pre><code class=\"lua\">player = {     pos = {          X = 20,          Y = 30,     },     filename = &quot;res\/images\/player.png&quot;,     HP = 20, --  \u0430 \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c } <\/code><\/pre>\n<p>  \u0421 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">LuaScript script(&quot;player.lua&quot;); std::string filename = script.get&lt;std::string&gt;(&quot;player.filename&quot;); int posX = script.get&lt;std::string&gt;(&quot;player.pos.X&quot;); <\/code><\/pre>\n<p>  \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0434 \u0431\u044b\u043b \u043f\u043e\u043d\u044f\u0442\u0435\u043d, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0435\u043a Lua \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b.<br \/>  \u041f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e <a href=\"http:\/\/www.lua.org\/pil\/24.html\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430:  <\/p>\n<pre><code class=\"cpp\">#ifndef LUASCRIPT_H #define LUASCRIPT_H   #include &lt;string&gt; #include &lt;vector&gt; #include &lt;iostream&gt;   \/\/ Lua \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 C, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b \u0445\u044d\u0434\u0435\u0440\u044b \u043a\u0430\u043a \u043a\u043e\u0434 \u043d\u0430 C extern &quot;C&quot; { # include &quot;lua.h&quot; # include &quot;lauxlib.h&quot; # include &quot;lualib.h&quot; }   class LuaScript { public:     LuaScript(const std::string& filename);     ~LuaScript();     void printError(const std::string& variableName, const std::string& reason);       template&lt;typename T&gt;     T get(const std::string& variableName) {         \/\/ \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0437\u0436\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435     }     \/\/ \u0412\u043e\u0437\u0440\u0430\u0449\u0430\u0435\u043c 0 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e     template&lt;typename T&gt;     T lua_get(const std::string& variableName) {       return 0;     }     \/\/ \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e     \/\/ \u043d\u0443\u043b\u0435\u0432\u043e\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435     template&lt;typename T&gt;     T lua_getdefault(const std::string& variableName) {       return 0;     } private:     lua_State* L; };   #endif <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440:  <\/p>\n<pre><code class=\"cpp\">LuaScript::LuaScript(const std::string& filename) {     L = luaL_newstate();     if (luaL_loadfile(L, filename.c_str()) || lua_pcall(L, 0, 0, 0)) {         std::cout&lt;&lt;&quot;Error: script not loaded (&quot;&lt;&lt;filename&lt;&lt;&quot;)&quot;&lt;&lt;std::endl;         L = 0;     } } <\/code><\/pre>\n<p>.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0451\u043c lua_State, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d, \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043a\u0430\u043a\u0430\u044f-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c.<br \/>  \u0414\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440:  <\/p>\n<pre><code class=\"cpp\">LuaScript::~LuaScript() {     if(L) lua_close(L); } <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 <b>printError<\/b> \u0441\u043e\u0437\u0434\u0430\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445:  <\/p>\n<pre><code class=\"cpp\">void LuaScript::printError(const std::string& variableName, const std::string& reason) {     std::cout&lt;&lt;&quot;Error: can't get [&quot;&lt;&lt;variableName&lt;&lt;&quot;]. &quot;&lt;&lt;reason&lt;&lt;std::endl; } <\/code><\/pre>\n<p>  <b>lua_getdefault<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430. \u0418 \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u043e\u043b\u044c, \u0442\u043e \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 (\u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0445\u044d\u0434\u0435\u0440\u0435).  <\/p>\n<pre><code class=\"cpp\">template&lt;&gt; inline std::string LuaScript::lua_getdefault&lt;std::string&gt;() {   return &quot;null&quot;; } <\/code><\/pre>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b>get<\/b>.<br \/>  \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u041f\u0443\u0441\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u00abplayer.pos.X\u00bb \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 Player.lua<br \/>  \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0446\u0438\u043a\u043b\u043e\u043c \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0442\u043e\u0447\u043a\u0438, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u00abvar\u00bb. <br \/>  \u00abplayer\u00bb \u2014 \u0442\u0430\u0431\u043b\u0438\u0446\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0451 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>lua_getglobal<\/b>.<br \/>  \u00abpos\u00bb \u0438 \u00abX\u00bb \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435, \u043d\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<b> lua_getfield<\/b>, \u0442.\u043a. \u0441\u0430\u043c\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 player \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0441\u0442\u0435\u043a\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0430\u044f \u0434\u043b\u044f \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0435\u043a \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<b> lua_getdefault<\/b>.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage3\/b84\/34c\/344\/b8434c344d8712c2bcbeb68bbc5a81f1.png\"\/>  <\/p>\n<pre><code class=\"cpp\"> template &lt;typename T&gt; T get(const std::string& variableName) {       if(!L) {         printError(variableName, &quot;Script is not loaded&quot;);         return lua_getdefault&lt;T&gt;();       }       int level = 0;       std::string var = &quot;&quot;;       for(unsigned int i = 0; i &lt; variableName.size(); i++) {         if(variableName.at(i) == '.') {           if(level == 0) {             lua_getglobal(L, var.c_str());           } else {             lua_getfield(L, -1, var.c_str());           }                       if(lua_isnil(L, -1)) {             printError(variableName, var + &quot; is not defined&quot;);             return lua_getdefault&lt;T&gt;();           } else {             var = &quot;&quot;;             level++;           }         } else {           var += variableName.at(i);         }       }       if(level == 0) {         lua_getglobal(L, var.c_str());       } else {         lua_getfield(L, -1, var.c_str());       }       if(lua_isnil(L, -1)) {           printError(variableName, var + &quot; is not defined&quot;);           return lua_getdefault&lt;T&gt;();       }         T result = lua_get&lt;T&gt;(variableName);       lua_pop(L, level + 1); \/\/ pop all existing elements from stack       return result; } <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0430\u0446\u0438\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432(\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445):  <\/p>\n<pre><code class=\"cpp\">template &lt;&gt; inline bool LuaScript::lua_get&lt;bool&gt;(const std::string& variableName) {     return (bool)lua_toboolean(L, -1); }   template &lt;&gt; inline float LuaScript::lua_get&lt;float&gt;(const std::string& variableName) {     if(!lua_isnumber(L, -1)) {       printError(variableName, &quot;Not a number&quot;);     }     return (float)lua_tonumber(L, -1); }   template &lt;&gt; inline int LuaScript::lua_get&lt;int&gt;(const std::string& variableName) {     if(!lua_isnumber(L, -1)) {       printError(variableName, &quot;Not a number&quot;);     }     return (int)lua_tonumber(L, -1); }   template &lt;&gt; inline std::string LuaScript::lua_get&lt;std::string&gt;(const std::string& variableName) {     std::string s = &quot;null&quot;;     if(lua_isstring(L, -1)) {       s = std::string(lua_tostring(L, -1));     } else {       printError(variableName, &quot;Not a string&quot;);     }     return s; } <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451. \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/github.com\/EliasD\/unnamed_lua_binder\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0422\u0430\u043c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h5>\u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/h5>\n<p>  \u0423 Lua \u0435\u0449\u0451 \u043c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043e\u043f\u0438\u0448\u0443 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0443\u0449\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b Player \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043e\u043d \u0431\u044b\u043b \u0431\u044b \u0442\u0430\u043a\u0438\u043c:[\u00abpos\u00bb, \u00abfilename\u00bb, \u00abHP\u00bb])<br \/>  \u0410 \u0435\u0449\u0451 \u0438\u0437 Lua \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c C++ \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0438\u0437 C++ \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Lua, \u043e \u0447\u0451\u043c \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0447\u0430\u0441\u0442\u0438.<br \/>  \u0423\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0438\u043d\u0433\u0430! \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/197300\/\"> http:\/\/habrahabr.ru\/post\/197300\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041a\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/github.com\/EliasD\/unnamed_lua_binder\">\u0437\u0434\u0435\u0441\u044c<\/a>.  <\/p>\n<h5>\u0427\u0435\u043c \u0442\u0430\u043a \u0445\u043e\u0440\u043e\u0448 Lua?<\/h5>\n<p>  \u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b \u0441\u0432\u043e\u044e \u0438\u0433\u0440\u0443 \u0438 \u0437\u0430\u0434\u0430\u043b\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c: \u0430 \u043a\u0430\u043a\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<br \/>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b: \u043e\u0434\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <a href=\"http:\/\/www.json.org\/\">JSON<\/a>, \u0434\u0440\u0443\u0433\u0438\u0435 \u2014 XML, \u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0443 \u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u0445\u0440\u0430\u043d\u044f\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 .txt \u0444\u0430\u0439\u043b\u0430\u0445 \u0438\u043b\u0438 \u043f\u0438\u0448\u0443\u0442 \u0441\u0432\u043e\u0438 \u043f\u0430\u0440\u0441\u0435\u0440\u044b. \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u043d\u0430 Lua.<\/p>\n<p>  Lua \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0438\u0433\u0440, \u043d\u043e \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0430\u0439\u043b\u0430\u0445. <\/p>\n<p>  \u0412\u043e\u0442, \u0447\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 Lua \u043d\u0430 \u0444\u043e\u043d\u0435 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432:  <\/p>\n<ul>\n<li>Lua \u043b\u0435\u0433\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u043a\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Lua \u0438 \u0442\u0440\u0451\u0445 .h \u0444\u0430\u0439\u043b\u043e\u0432).<\/li>\n<li>\u0412 Lua \u0444\u0430\u0439\u043b\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 Lua. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<br \/> \n<pre><code class=\"lua\">some_variable = math.sqrt(2) * 2 some_variable2 = 64 * 16 - 32 <\/code><\/pre>\n<p>  <\/li>\n<li>Lua \u2014 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u044f\u0437\u044b\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438.<\/li>\n<li>\u0423 Lua <a href=\"http:\/\/www.lua.org\/license.html\">\u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f MIT<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043a\u0430\u043a \u0432 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445, \u0442\u0430\u043a \u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043f\u0440\u0438\u0447\u0451\u043c \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u043e\u0439 \u0432\u043e\u0437\u043d\u0438 \u0441 \u0431\u0443\u043c\u0430\u0433\u0430\u043c\u0438. \u041a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435: \u00ab\u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c\u00bb.<\/li>\n<li>Lua \u043a\u043e\u043c\u043f\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0437\u0434\u0435, \u0442.\u043a. \u043e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c C \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/li>\n<li>\u0414\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u043c \u0433\u043b\u0430\u0437\u0443 \u0432\u0438\u0434\u0435. \u0418\u0445 \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435.<\/li>\n<\/ul>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u044f \u043f\u0435\u0440\u0435\u0439\u0434\u0443 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-197300","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/197300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=197300"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/197300\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=197300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=197300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=197300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}