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


C# Interpreter.InitInterpreter方法代码示例

本文整理汇总了C#中Interpreter.InitInterpreter方法的典型用法代码示例。如果您正苦于以下问题:C# Interpreter.InitInterpreter方法的具体用法?C# Interpreter.InitInterpreter怎么用?C# Interpreter.InitInterpreter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Interpreter的用法示例。


在下文中一共展示了Interpreter.InitInterpreter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DumpMeshViewerFile

        public static void DumpMeshViewerFile(String file)
        {
            PCCObject pcc = new PCCObject(file);
            int index = 0;
            string savepath = Directory.GetParent(file) + "\\" + Path.GetFileNameWithoutExtension(file) + "_meshmap.txt";
            using (StreamWriter stringoutput = new StreamWriter(savepath))
            {
                foreach (PCCObject.ExportEntry exp in pcc.Exports)
                {
                    index++;
                    if (exp.ClassName == "PathNode")
                    {
                        Console.WriteLine(exp.ClassName);

                        Interpreter i = new Interpreter();
                        i.Pcc = pcc;
                        i.Index = index - 1; //0-based array
                        i.InitInterpreter();
                        TreeNode top = i.topNode;

                        if (top.Children.Count > 0 && top.Children[0].Tag != Interpreter.nodeType.None)
                        {
                            //stringoutput.WriteLine(String.Format("|{0,40}|{1,15}|{2,10}|{3,30}|", "Name", "Type", "Size", "Value"));
                            top.PrintMeshViewer("", stringoutput, false);
                        }
                    }
                }
            }
        }
开发者ID:Mgamerz,项目名称:ME3-GUI-Transplanter,代码行数:29,代码来源:TransplanterLib.cs

示例2: dumpPCCFile


//.........这里部分代码省略.........
                        int numTotal = pcc.Exports.Count;
                        int lastProgress = 0;
                        writeVerboseLine("Enumerating exports");
                        Boolean needsFlush = false;
                        int index = 0;
                        foreach (PCCObject.ExportEntry exp in pcc.Exports)
                        {
                            index++;
                            writeVerboseLine("Parse export #" + index);

                            //Boolean isCoalesced = coalesced && exp.likelyCoalescedVal;
                            Boolean isCoalesced = exp.likelyCoalescedVal;
                            Boolean isScript = scripts && (exp.ClassName == "Function");
                            Boolean isEnum = exp.ClassName == "Enum";
                            int progress = ((int)(((double)numDone / numTotal) * 100));
                            while (progress >= (lastProgress + 10))
                            {
                                Console.Write("..." + (lastProgress + 10) + "%");
                                needsFlush = true;
                                lastProgress += 10;
                            }
                            if (exports || data || isScript || isCoalesced)
                            {
                                if (separateExports)
                                {
                                    stringoutput.WriteLine("=======================================================================");
                                }
                                stringoutput.Write("#" + index + " ");
                                if (isCoalesced)
                                {
                                    stringoutput.Write("[C] ");
                                }

                                if (exports || isCoalesced || isScript)
                                {
                                    stringoutput.WriteLine(exp.PackageFullName + "." + exp.ObjectName + "(" + exp.ClassName + ") (Superclass: " + exp.ClassParentWrapped + ") (Data Offset: 0x " + exp.DataOffset.ToString("X4") + ")");
                                }

                                if (isEnum)
                                {
                                    SFXEnum sfxenum = new SFXEnum(pcc, exp.Data);
                                    stringoutput.WriteLine(sfxenum.ToString());
                                }

                                if (isScript)
                                {
                                    stringoutput.WriteLine("==============Function==============");
                                    Function func = new Function(exp.Data, pcc);
                                    stringoutput.WriteLine(func.ToRawText());
                                }
                                if (properties)
                                {
                                    Interpreter i = new Interpreter();
                                    i.Pcc = pcc;
                                    i.Index = index - 1; //0-based array
                                    i.InitInterpreter();
                                    TreeNode top = i.topNode;

                                    if (top.Children.Count > 0 && top.Children[0].Tag != Interpreter.nodeType.None)
                                    {
                                        stringoutput.WriteLine("=================================================Properties=================================================");
                                        //stringoutput.WriteLine(String.Format("|{0,40}|{1,15}|{2,10}|{3,30}|", "Name", "Type", "Size", "Value"));
                                        top.PrintPretty("", stringoutput, false);
                                        stringoutput.WriteLine();
                                    }
                                }
                                if (data)
                                {
                                    stringoutput.WriteLine("==============Data==============");
                                    stringoutput.WriteLine(BitConverter.ToString(exp.Data));
                                }
                            }
                            numDone++;
                        }
                        stringoutput.WriteLine("--End of " + datasets);

                        if (needsFlush)
                        {
                            Console.WriteLine();
                        }
                    }

                    if (names)
                    {
                        writeVerboseLine("Gathering names");
                        stringoutput.WriteLine("--Names");

                        int count = 0;
                        foreach (string s in pcc.Names)
                            stringoutput.WriteLine((count++) + " : " + s);
                        stringoutput.WriteLine("--End of Names");

                    }
                }
            }
            //catch (Exception e)
            //{
            //    Console.WriteLine("Exception parsing " + file + "\n" + e.Message);
            //}
        }
开发者ID:Mgamerz,项目名称:ME3-GUI-Transplanter,代码行数:101,代码来源:TransplanterLib.cs


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