public static void Write(Stream stream, Bep bep) { BinaryMapping.WriteObject <Header>(stream, bep.header); for (int c = 0; c < bep.disappearParameters.Count; c++) { BinaryMapping.WriteObject <BaseParameter>(stream, bep.baseParameters[c]); } for (int d = 0; d < bep.disappearParameters.Count; d++) { BinaryMapping.WriteObject <DisappearParameter>(stream, bep.disappearParameters[d]); } }
public static Bep Read(Stream stream) { Bep bep = new Bep(); bep.header = BinaryMapping.ReadObject <Header>(stream); stream.Seek(bep.header.BaseParametersOffset, SeekOrigin.Begin); bep.baseParameters = new List <BaseParameter>(); for (int c = 0; c < bep.header.BaseParametersCount; c++) { bep.baseParameters.Add(BinaryMapping.ReadObject <BaseParameter>(stream)); } stream.Seek(bep.header.DisappearParametersOffset, SeekOrigin.Begin); bep.disappearParameters = new List <DisappearParameter>(); for (int d = 0; d < bep.header.DisappearParametersCount; d++) { bep.disappearParameters.Add(BinaryMapping.ReadObject <DisappearParameter>(stream)); } return(bep); }