FSO.Files.Formats.IFF.Chunks.OBJf.Read C# (CSharp) Method

Read() public method

Reads a OBJf chunk from a stream.
public Read ( IffFile iff, Stream stream ) : void
iff IffFile An Iff instance.
stream Stream A Stream object holding a OBJf chunk.
return void
        public override void Read(IffFile iff, Stream stream)
        {
            using (var io = IoBuffer.FromStream(stream, ByteOrder.LITTLE_ENDIAN))
            {
                io.ReadUInt32(); //pad
                Version = io.ReadUInt32();
                string magic = io.ReadCString(4);
                functions = new OBJfFunctionEntry[io.ReadUInt32()];
                for (int i=0; i<functions.Length; i++) {
                    var result = new OBJfFunctionEntry();
                    result.ConditionFunction = io.ReadUInt16();
                    result.ActionFunction = io.ReadUInt16();
                    functions[i] = result;
                }
            }
        }