Example #1
0
 // Token: 0x0600002F RID: 47 RVA: 0x00003E38 File Offset: 0x00002038
 private static void WriteNode(DTBTreeItem Node, BinaryWriter Output)
 {
     Output.Write((int)Node.Type);
     if (Node is DTBTreeInteger)
     {
         DTBTreeInteger dtbtreeInteger = (DTBTreeInteger)Node;
         Output.Write(dtbtreeInteger.Integer);
         return;
     }
     if (Node is DTBTreeFloat)
     {
         DTBTreeFloat dtbtreeFloat = (DTBTreeFloat)Node;
         Output.Write(dtbtreeFloat.Float);
         return;
     }
     if (Node is DTBTreeString)
     {
         DTBTreeString dtbtreeString = (DTBTreeString)Node;
         byte[]        bytes         = Encoding.GetEncoding(1252).GetBytes(dtbtreeString.String);
         Output.Write(bytes.Length);
         Output.Write(bytes);
         return;
     }
     if (Node is DTBTreeInnerNode)
     {
         DTBTreeInnerNode innerNode = (DTBTreeInnerNode)Node;
         DTBWriter.WriteNodeList(innerNode, Output);
         return;
     }
     throw new DTBException("Internal Error (DTB Writer: Unknown type).");
 }
Example #2
0
        // Token: 0x06000032 RID: 50 RVA: 0x00003F14 File Offset: 0x00002114
        private static void ReadNodeList(DTBTreeInnerNode InnerNode, BinaryReader Input)
        {
            int num = (int)Input.ReadInt16();

            InnerNode.LineNumber = Input.ReadInt32();
            for (int i = 0; i < num; i++)
            {
                DTBTreeItem item = DTBReader.ReadNode(Input);
                InnerNode.SubNodes.Add(item);
            }
        }
Example #3
0
 // Token: 0x0600004C RID: 76 RVA: 0x000050A8 File Offset: 0x000032A8
 public static void Print(DTBTreeItem Node, TextWriter Output, int TabCount)
 {
     for (int i = 0; i < TabCount; i++)
     {
         Output.Write("\t");
     }
     if (Node is DTBTreeInteger)
     {
         DTBTreeInteger dtbtreeInteger = (DTBTreeInteger)Node;
         Output.WriteLine("DTBTreeInteger = " + dtbtreeInteger.Integer.ToString());
         return;
     }
     if (Node is DTBTreeFloat)
     {
         DTBTreeFloat dtbtreeFloat = (DTBTreeFloat)Node;
         Output.WriteLine("DTBTreeFloat = " + dtbtreeFloat.Float.ToString());
         return;
     }
     if (Node is DTBTreeString)
     {
         DTBTreeString dtbtreeString = (DTBTreeString)Node;
         Output.WriteLine("DTBTreeString = " + dtbtreeString.String.ToString());
         return;
     }
     if (Node is DTBTreeInnerNode)
     {
         DTBTreeInnerNode dtbtreeInnerNode = (DTBTreeInnerNode)Node;
         Output.WriteLine("DTBTreeInnerNode > Line " + dtbtreeInnerNode.LineNumber.ToString());
         using (List <DTBTreeItem> .Enumerator enumerator = dtbtreeInnerNode.SubNodes.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 DTBTreeItem node = enumerator.Current;
                 DTBDebugger.Print(node, Output, TabCount + 1);
             }
             return;
         }
     }
     throw new DTBException("Internal Error (DTB Debugger: Unknown type).");
 }
Example #4
0
        // Token: 0x06000033 RID: 51 RVA: 0x00003F54 File Offset: 0x00002154
        private static DTBTreeItem ReadNode(BinaryReader Input)
        {
            DTBType dtbtype   = (DTBType)Input.ReadInt32();
            Type    classType = DTBTreeItem.GetClassType(dtbtype);

            if (classType == typeof(DTBTreeInteger))
            {
                return(new DTBTreeInteger
                {
                    Type = dtbtype,
                    Integer = Input.ReadInt32()
                });
            }
            if (classType == typeof(DTBTreeFloat))
            {
                return(new DTBTreeFloat
                {
                    Type = dtbtype,
                    Float = Input.ReadSingle()
                });
            }
            if (classType == typeof(DTBTreeString))
            {
                DTBTreeString dtbtreeString = new DTBTreeString();
                int           num           = Input.ReadInt32();
                byte[]        array         = new byte[num];
                Input.Read(array, 0, num);
                dtbtreeString.Type   = dtbtype;
                dtbtreeString.String = Encoding.GetEncoding(1252).GetString(array);
                return(dtbtreeString);
            }
            if (classType == typeof(DTBTreeInnerNode))
            {
                DTBTreeInnerNode dtbtreeInnerNode = new DTBTreeInnerNode();
                dtbtreeInnerNode.Type = dtbtype;
                DTBReader.ReadNodeList(dtbtreeInnerNode, Input);
                return(dtbtreeInnerNode);
            }
            throw new DTBException("Unknown type \"" + dtbtype.ToString() + "\"");
        }
Example #5
0
 // Token: 0x0600004B RID: 75 RVA: 0x0000509B File Offset: 0x0000329B
 public static void Print(DTBTreeItem Node, TextWriter Output)
 {
     DTBDebugger.Print(Node, Output, 0);
 }
Example #6
0
 // Token: 0x0600004A RID: 74 RVA: 0x0000508D File Offset: 0x0000328D
 public static void Print(DTBTreeItem Node)
 {
     DTBDebugger.Print(Node, Console.Out, 0);
 }