Summary
In this chapter, we learned how to work with Lua tables in C++. We also touched on OOP in Lua and how it differs from that in C++.
We also explored some design decisions and why LuaExecutor
is implemented in the way it is. It is designed to learn how to integrate Lua with C++, with a structure that can be broken down into chapters.
By now, you can use LuaExecutor
to call most Lua scripts, although it has some limitations. For example, we do not support passing another table, except self
, as a parameter to a function. You can try to implement such a function on your own, but it is likely not a good idea. It is better to keep the communication between Lua and C++ simple.
Take your time to experiment and practice what we have learned. The focus so far is on how to call Lua code from C++. In the next chapter, we will start to learn how to call C++ code from Lua.