internal static W3dAggregateClassInfo Parse(BinaryReader reader, W3dParseContext context) { return(ParseChunk(reader, context, header => { var result = new W3dAggregateClassInfo { OriginalClassID = reader.ReadUInt32(), Flags = reader.ReadUInt32(), UnknownBytes = reader.ReadBytes((int)context.CurrentEndPosition - (int)reader.BaseStream.Position) }; // TODO: Determine what the flags do/are. // TODO: Determine W3dAggregateClassInfo UnknownBytes. return result; })); }
internal static W3dAggregate Parse(BinaryReader reader, W3dParseContext context) { var parsedChunk = ParseChunk(reader, context, header => { var result = new W3dAggregate(); ParseChunks(reader, context.CurrentEndPosition, chunkType => { switch (chunkType) { case W3dChunkType.W3D_CHUNK_AGGREGATE_CLASS_INFO: result.ClassInfo = W3dAggregateClassInfo.Parse(reader, context); break; case W3dChunkType.W3D_CHUNK_AGGREGATE_HEADER: result.Header = W3dAggregateHeader.Parse(reader, context); break; case W3dChunkType.W3D_CHUNK_AGGREGATE_INFO: result.Info = W3dAggregateInfo.Parse(reader, context); break; case W3dChunkType.W3D_CHUNK_TEXTURE_REPLACER_INFO: result.TextureReplacerInfo = W3dTextureReplacerInfo.Parse(reader, context); break; default: throw CreateUnknownChunkException(chunkType); } }); return(result); }); return(parsedChunk); }