当前位置: 首页>>代码示例>>C#>>正文


C# Lua.GetTableDict方法代码示例

本文整理汇总了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);
            }

              }
        }
开发者ID:ZeroK-RTS,项目名称:SpringRTS-Tools,代码行数:68,代码来源:TableProxy.cs

示例2: TableProxy

 public TableProxy(LuaTable table, TableType tableType, Lua lua)
 {
     this.table = lua.GetTableDict(table);
     this.tableType = tableType;
     this.lua = lua;
 }
开发者ID:ZeroK-RTS,项目名称:SpringRTS-Tools,代码行数:6,代码来源:TableProxy.cs


注:本文中的LuaInterface.Lua.GetTableDict方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。