本文整理汇总了C#中LuaInterface.Lua.GetTableDict方法的典型用法代码示例。如果您正苦于以下问题:C# Lua.GetTableDict方法的具体用法?C# Lua.GetTableDict怎么用?C# Lua.GetTableDict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LuaInterface.Lua
的用法示例。
在下文中一共展示了Lua.GetTableDict方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Changes
public virtual void Changes(RichTextBox rb, string tblName, LuaTable againstTable, Lua againstLua)
{
ListDictionary against = againstLua.GetTableDict(againstTable);
List<DictionaryEntry> items = new List<DictionaryEntry>();
int maxlen = 0;
bool allNumber = true;
int cnt = 1;
foreach (DictionaryEntry de in table) {
items.Add(de);
int len = de.Key.ToString().Length;
if (len > maxlen) maxlen = len;
if (!(de.Key is Double) || (int)(double)de.Key != cnt) allNumber = false;
cnt++;
}
bool firstLine = true;
foreach (DictionaryEntry de in items) {
if (against[de.Key] == null) {
StringBuilder sb = new StringBuilder();
if (firstLine) {
rb.SelectionColor = Color.Black;
rb.AppendText("\r\n=============================\r\n" + tblName + "\r\n=============================\r\n");
firstLine = false;
}
rb.SelectionColor = Color.Green;
FormatEntry(sb, maxlen, allNumber, 0, de);
sb.AppendLine();
rb.SelectedText = sb.ToString();
} else if (de.Value != null && against[de.Key].ToString() != de.Value.ToString() && !(de.Value is LuaTable)) {
if (firstLine) {
rb.SelectionColor = Color.Black;
rb.AppendText("\r\n=============================\r\n" + tblName + "\r\n=============================\r\n");
firstLine = false;
}
rb.SelectionColor = Color.Blue;
StringBuilder sb = new StringBuilder();
FormatEntry(sb, maxlen, allNumber, 0, de);
sb.Append(" <- ");
sb.AppendFormat("{0}", against[de.Key]);
sb.AppendLine();
rb.SelectedText = sb.ToString();
}
}
foreach (DictionaryEntry de in against) {
if (table[de.Key] == null) {
if (firstLine) {
rb.SelectionColor = Color.Black;
rb.AppendText("\r\n=============================\r\n" + tblName + "\r\n=============================\r\n");
firstLine = false;
}
rb.SelectionColor = Color.Red;
StringBuilder sb = new StringBuilder();
FormatEntry(sb, maxlen, allNumber, 0, de);
sb.AppendLine();
rb.SelectedText = sb.ToString();
}
}
foreach (DictionaryEntry de in table) {
if (against[de.Key] != null && de.Value is LuaTable) {
new TableProxy((LuaTable)de.Value, lua).Changes(rb, tblName + "/" + de.Key, (LuaTable)against[de.Key], againstLua);
}
}
}
示例2: TableProxy
public TableProxy(LuaTable table, TableType tableType, Lua lua)
{
this.table = lua.GetTableDict(table);
this.tableType = tableType;
this.lua = lua;
}