Beispiel #1
0
        private static void FormatValueNode(BYML Owner, StringBuilder b, byte Type, uint Value)
        {
            // A0 String
            // A1 Path?
            // C0 Array
            // C1 Dictionary
            // C2 String Table
            // C3 Path Table???
            // D0 Boolean
            // D1 Integer
            // D2 Float

            switch (Type)
            {
            case 0xA0: b.AppendFormat(" {0}", Owner.StringValueTableNode.StringTable[Value]); break;

            case 0xA1:
                break;

            case 0XD0: b.AppendFormat(" {0}", (Value == 1) ? "true" : "false"); break;

            case 0xD1: b.AppendFormat(" {0}", (int)Value); break;

            case 0xD2: b.AppendFormat(" {0}", BitConverter.ToSingle(BitConverter.GetBytes(Value), 0).ToString().Replace(",", ".")); break;

            default: b.AppendFormat(" {0:X8}", Value); break;
            }
        }
Beispiel #2
0
 public virtual void WriteYAML(BYML Owner, StringBuilder b, int Indent, bool FirstIndent = true)
 {
     if (FirstIndent)
     {
         b.Append(new String(' ', Indent * 2));
     }
     b.AppendLine("Unknown Full Node (0x" + NodeType.ToString("X2") + ")");
 }
Beispiel #3
0
 public override void WriteYAML(BYML Owner, StringBuilder b, int Indent, bool FirstIndent = true)
 {
     for (int i = 0; i < NrEntries; i++)
     {
         if (i != 0 || FirstIndent)
         {
             b.Append(new String(' ', Indent * 2));
         }
         b.AppendFormat("{0}:", Owner.NodeNameTableNode.StringTable[SubNodes[i].StringIndex]);
         if ((SubNodes[i].NodeType >> 4) == 0xC)
         {
             b.AppendLine();
             SubNodes[i].FullNode.WriteYAML(Owner, b, Indent + 1);
         }
         else
         {
             FormatValueNode(Owner, b, SubNodes[i].NodeType, SubNodes[i].Value);
             b.AppendLine();
         }
     }
 }
Beispiel #4
0
 public override void WriteYAML(BYML Owner, StringBuilder b, int Indent, bool FirstIndent = true)
 {
     for (int i = 0; i < NrEntries; i++)
     {
         if (i != 0 || FirstIndent)
         {
             b.Append(new String(' ', Indent * 2));
         }
         b.Append("- ");
         if ((NodeTypes[i] >> 4) == 0xC)
         {
             FullNodes[i].WriteYAML(Owner, b, Indent + 1, false);
             b.AppendLine();
         }
         else
         {
             FormatValueNode(Owner, b, NodeTypes[i], Values[i]);
             b.AppendLine();
         }
     }
 }