internal override void Serialize(IDefinitionWriter writer) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } writer.WriteValueU8((byte)this.Visibility); writer.WriteValueU32((uint)this.Flags); if ((this.Flags & FunctionFlags.IsNative) == 0) { writer.WriteReference(this.SourceFile); writer.WriteValueU32(this.SourceLine); } if ((this.Flags & FunctionFlags.HasReturnValue) != 0) { writer.WriteReference(this.ReturnType); writer.WriteValueB8(this.Unknown50); } if ((this.Flags & FunctionFlags.Unknown8) != 0) { writer.WriteReference(this.Unknown58); } if ((this.Flags & FunctionFlags.HasParameters) != 0) { writer.WriteReferences(this.Parameters); } if ((this.Flags & FunctionFlags.HasLocals) != 0) { writer.WriteReferences(this.Locals); } if ((this.Flags & FunctionFlags.Unknown6) != 0) { writer.WriteValueU32(this.Unknown98); } if ((this.Flags & FunctionFlags.Unknown12) != 0) { writer.WriteValueU8(this.UnknownA0); } if ((this.Flags & FunctionFlags.HasBody) != 0) { var bodySizePosition = writer.Position; writer.WriteValueU32(uint.MaxValue); var bodySize = Instructions.Write(writer, this.Body); var endPosition = writer.Position; writer.Position = bodySizePosition; writer.WriteValueU32(bodySize); writer.Position = endPosition; } }
internal override void Serialize(IDefinitionWriter writer) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } writer.WriteValueU8(this.Unknown2A); writer.WriteValueU8(this.Size); writer.WriteReferences(this.Enumerals); writer.WriteValueB8(this.Unknown29); }