| 101 | } |
| 102 | |
| 103 | void LuaContext::setCallbacks(String const& tableName, LuaCallbacks const& callbacks) const { |
| 104 | auto& eng = engine(); |
| 105 | if (LuaContext::contains(tableName)) |
| 106 | return; |
| 107 | |
| 108 | auto callbackTable = eng.createTable(); |
| 109 | for (auto const& p : callbacks.callbacks()) |
| 110 | callbackTable.set(p.first, eng.createWrappedFunction(p.second)); |
| 111 | LuaContext::set(tableName, callbackTable); |
| 112 | } |
| 113 | |
| 114 | LuaString LuaContext::createString(String const& str) { |
| 115 | return engine().createString(str); |