mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-19 08:21:22 +00:00
36 lines
1,019 B
C#
36 lines
1,019 B
C#
|
using System.IO;
|
|||
|
using FSO.Files.Utils;
|
|||
|
|
|||
|
namespace FSO.Files.Formats.IFF.Chunks
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// This chunk type holds the name of a sound event that this object uses.
|
|||
|
/// </summary>
|
|||
|
public class FWAV : IffChunk
|
|||
|
{
|
|||
|
public string Name;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// Reads a FWAV chunk from a stream.
|
|||
|
/// </summary>
|
|||
|
/// <param name="iff">An Iff instance.</param>
|
|||
|
/// <param name="stream">A Stream object holding a FWAV chunk.</param>
|
|||
|
public override void Read(IffFile iff, Stream stream)
|
|||
|
{
|
|||
|
using (var io = IoBuffer.FromStream(stream, ByteOrder.LITTLE_ENDIAN))
|
|||
|
{
|
|||
|
Name = io.ReadNullTerminatedString();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public override bool Write(IffFile iff, Stream stream)
|
|||
|
{
|
|||
|
using (var io = IoWriter.FromStream(stream, ByteOrder.LITTLE_ENDIAN))
|
|||
|
{
|
|||
|
io.WriteNullTerminatedString(Name);
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|