private void _read() { _code = m_io.EnsureFixedContents(new byte[] { 1, 0, 0, 0 }); _headerSize = m_io.ReadU4le(); _version = m_io.ReadU4le(); switch (M_Parent.Code) { case RenderwareBinaryStream.Sections.TextureDictionary: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructTextureDictionary(io___raw_header, this, m_root); break; } case RenderwareBinaryStream.Sections.GeometryList: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructGeometryList(io___raw_header, this, m_root); break; } case RenderwareBinaryStream.Sections.Clump: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructClump(io___raw_header, this, m_root); break; } case RenderwareBinaryStream.Sections.FrameList: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructFrameList(io___raw_header, this, m_root); break; } case RenderwareBinaryStream.Sections.Geometry: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructGeometry(io___raw_header, this, m_root); break; } default: { _header = m_io.ReadBytes(HeaderSize); break; } } _entries = new List <RenderwareBinaryStream>(); { var i = 0; while (!m_io.IsEof) { _entries.Add(new RenderwareBinaryStream(m_io)); i++; } } }
private void _read() { _code = m_io.ReadBytes(4); if (!((KaitaiStream.ByteArrayCompare(Code, new byte[] { 1, 0, 0, 0 }) == 0))) { throw new ValidationNotEqualError(new byte[] { 1, 0, 0, 0 }, Code, M_Io, "/types/list_with_header/seq/0"); } _headerSize = m_io.ReadU4le(); _libraryIdStamp = m_io.ReadU4le(); switch (M_Parent.Code) { case RenderwareBinaryStream.Sections.Geometry: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructGeometry(io___raw_header, this, m_root); break; } case RenderwareBinaryStream.Sections.TextureDictionary: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructTextureDictionary(io___raw_header, this, m_root); break; } case RenderwareBinaryStream.Sections.GeometryList: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructGeometryList(io___raw_header, this, m_root); break; } case RenderwareBinaryStream.Sections.Clump: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructClump(io___raw_header, this, m_root); break; } case RenderwareBinaryStream.Sections.FrameList: { __raw_header = m_io.ReadBytes(HeaderSize); var io___raw_header = new KaitaiStream(__raw_header); _header = new StructFrameList(io___raw_header, this, m_root); break; } default: { _header = m_io.ReadBytes(HeaderSize); break; } } _entries = new List <RenderwareBinaryStream>(); { var i = 0; while (!m_io.IsEof) { _entries.Add(new RenderwareBinaryStream(m_io)); i++; } } }