本文整理匯總了C#中SharpLua.LuaTypes.LuaTable.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# LuaTable.ToString方法的具體用法?C# LuaTable.ToString怎麽用?C# LuaTable.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SharpLua.LuaTypes.LuaTable
的用法示例。
在下文中一共展示了LuaTable.ToString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PrintTable
private static void PrintTable(LuaTable tbl, string indent, LuaValue _key = null)
{
/* sample output:
table: 002CCBA8
{
field = value
X = 10
y = function: 002CCBA8
}
*/
string i = indent;
A8Console.Write(i);
if (_key != null)
A8Console.Write(_key.ToString() + " = ");
A8Console.WriteLine(tbl.ToString() + "\n" + i + "{");
foreach (LuaValue key in tbl.Keys)
{
LuaValue v = tbl.GetValue(key);
if (v.GetTypeCode() == "table")
{
// check that its not a reference of itself
if (!scanned.ContainsKey(key))
{
scanned.SetKeyValue(key, v);
PrintTable(v as LuaTable, i + " ", key);
}
else
{
A8Console.WriteLine(i + " " + key.ToString() + " = " + v.ToString());
}
}
else
{
scanned.SetKeyValue(key, v);
A8Console.WriteLine(i + " " + key.ToString() + " = " + v.ToString());
}
}/*
foreach (LuaValue key in tbl.MetaTable.Keys)
{
A8Console.WriteLine(i + "(MetaTable): " + key.ToString() + " = " + tbl.MetaTable.GetValue(key).ToString());
}*/
A8Console.WriteLine(i + "}");
}