LuaSharp
LuaSharp copied to clipboard
LuaTable to List?
How can one get a LuaTable into a C# list?
I have tried variations of:
public static System.Collections.Generic.List
but, I get a Mono crash when I try to generate the KeyValue Enumerator.
Ideas?
-Doug
Code was a bit wrong:
public static System.Collections.Generic.List ToList(LuaSharp.LuaTable table) {
System.Collections.Generic.List list = new System.Collections.Generic.List();
foreach(System.Collections.Generic.KeyValuePair pair in table) {
list.Add(pair.Key.ToString());
}
return list;
}