示例#1
0
 void WriteSummary(ExtendedStringBuilder sb)
 {
     sb.SetClassIndent();
     sb.AppendLine("/// <summary>");
     sb.AppendLine($"/// {ClassName}:{SuperClass}");
     sb.AppendLine($"/// Size: 0x{ClassSize:X2}");
     sb.AppendLine($"/// Properties: {Properties.Count}");
     sb.AppendLine("/// </summary>");
 }
示例#2
0
 public void BuildClass(ExtendedStringBuilder sb)
 {
     sb.SetClassIndent();
     WriteSummary(sb);
     if (string.IsNullOrEmpty(SuperClass))
     {
         SuperClass = "MemoryObject";
     }
     sb.AppendLine($"public class {ClassName}:{SuperClass}");
     sb.AppendLine("{");
     sb.SetPropertyIndent();
     sb.AppendLine($"public override int ObjectSize => {ClassSize};");
     foreach (var p in Properties.Values.ToArray())
     {
         p.BuildProperty(sb);
         sb.AppendLine("");
     }
     sb.SetClassIndent();
     sb.AppendLine("}");
     sb.SetNamespaceIndent();
     sb.AppendLine("");
     sb.AppendLine("");
 }