/// <summary> /// Reads lump from Binary Reader /// </summary> /// <param name="reader">Binary Reader to read from</param> /// <param name="lumpId">Lump Id</param> /// <returns></returns> public static Lump ReadLump(BinaryReader reader, int lumpId) { //Calculate and set offset reader.BaseStream.Position = BSPOffsets.CalculateLumpOffset(lumpId); //Read lump return(ReadLump(reader)); }
/// <summary> /// Writes lump informations /// </summary> /// <param name="writer">Binary writer to write to</param> /// <param name="info">Lump informations</param> /// <param name="lumpId">Id of lump</param> public static void WriteLump(BinaryWriter writer, Lump info, int lumpId) { //Set offset writer.BaseStream.Position = BSPOffsets.CalculateLumpOffset(lumpId); //Write lump data WriteLump(writer, info); }