Copy table contents to another table with exustung content
So I've had trouble finding a solution to this on my own.
The idea is to be able to support "plugins" to my addon. Disregard the unfinished state, as it is primary a learning project for myself. As seen i have my table named Stylemeter.datamodules here. Now i want to be able to write let's say a Damage Taken module which may look like something like this: Code:
dt = { I've come across deepcopy functions in my research, but all the do seems to make a direct copy of the table, i want to actually insert these keys and values to an existing one. Or is my approach here completely in the wrong direction? |
A generic recursive table copy function:
Code:
function Copy_Table(src, dest) Code:
ns.datamodules.DamageTaken = {} |
Lua Code:
|
Thank you very much, everyone!
Seems so simple, yet i've spent hours on figuring that out without success. Defenitely some elegant ways to accomplish this, that's neat. |
All times are GMT -6. The time now is 02:00 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI