using System.IO;
using FSO.Files.Utils;
namespace FSO.Files.Formats.IFF.Chunks
{
///
/// This chunk type assigns BHAV subroutines to a number of events that occur in
/// (or outside of?) the object, which are described in behavior.iff chunk 00F5.
///
public class OBJf : IffChunk
{
public OBJfFunctionEntry[] functions;
public uint Version;
///
/// Reads a OBJf chunk from a stream.
///
/// An Iff instance.
/// A Stream object holding a OBJf chunk.
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