如何编写 C++字典到Lua表?
我有一些 C++ 代码与一些 Lua 代码交互。基本上,我希望能够从查询消息中获取一些结果(以字典的形式,也称为项目集合),然后将它们作为表推送到 Lua,以便我可以通过以下方式轻松访问 Lua 的所有结果:使用字典。
现在,我只得到一个我想要的特定值并将其发送出去,但最好将所有这些值都发送出去,而不必请求特定的值。
I have some C++ code that interacts with some Lua code. Basically, I want to be able to get some results (in the form of a dictionary a.k.a. a collection of items) from a query message and then push them out to Lua as a table so that I can easily access all the results from Lua by using the dictionary.
Right now, I just get one specific value that I want and send that out but it would be nice to send all of them out and not have to request a specific one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您总体上熟悉 Lua API,以下是基本过程:
Assuming you're familiar with the Lua API in general, here's the basic process: